import { Vector2, Transformation, svgTransformationDecode, svgTransformationEncode, } from 'touchcontroller'; //todo maybe use on more places export function moveSvgGBy(element: SVGGElement, moveBy: Vector2) { let transformation = svgTransformationDecode( element.getAttribute('transform') || '', ); transformation = transformation.add(Transformation.translate(moveBy)); //todo in future use addInPlace element.setAttribute('transform', svgTransformationEncode(transformation)); }