consolidate existing transformations before the move.

master
JFH 2022-01-01 21:53:39 -03:00
parent a6773f8fea
commit 56be0aa6c4
2 changed files with 7 additions and 2 deletions

View File

@ -571,7 +571,6 @@ export const mouseUpEvent = (evt) => {
const x = mouseX / zoom
const y = mouseY / zoom
console.log(svgCanvas.getId())
let element = getElement(svgCanvas.getId())
let keep = false
@ -1012,6 +1011,13 @@ export const mouseDownEvent = (evt) => {
svgCanvas.setStartTransform(mouseTarget.getAttribute('transform'))
const tlist = mouseTarget.transform.baseVal
// consolidate transforms using standard SVG but keep the transformation used for the move/scale
if (tlist.numberOfItems > 1) {
const firstTransform = tlist.getItem(0)
tlist.removeItem(0)
tlist.consolidate()
tlist.insertItemBefore(firstTransform, 0)
}
switch (svgCanvas.getCurrentMode()) {
case 'select':
svgCanvas.setStarted(true)

View File

@ -270,7 +270,6 @@ export const recalculateDimensions = (selected) => {
}
const N = tlist.numberOfItems
console.log(N)
let tx = 0; let ty = 0; let operation = 0
let firstM