[HANASYS DESIGN] 회전 기능을 이용했을 때의 불량
This commit is contained in:
parent
6872c6bb16
commit
5ac023d72d
@ -181,8 +181,27 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, {
|
|||||||
return fabric.util.transformPoint(p, matrix)
|
return fabric.util.transformPoint(p, matrix)
|
||||||
})
|
})
|
||||||
this.points = transformedPoints
|
this.points = transformedPoints
|
||||||
const { left, top } = this.calcOriginCoords()
|
|
||||||
this.set('pathOffset', { x: left, y: top })
|
// 바운딩 박스 재계산 (width, height 업데이트 - fill 영역 수정)
|
||||||
|
const calcDim = this._calcDimensions({})
|
||||||
|
this.width = calcDim.width
|
||||||
|
this.height = calcDim.height
|
||||||
|
|
||||||
|
const newPathOffset = {
|
||||||
|
x: calcDim.left + this.width / 2,
|
||||||
|
y: calcDim.top + this.height / 2,
|
||||||
|
}
|
||||||
|
this.set('pathOffset', newPathOffset)
|
||||||
|
|
||||||
|
// 변환을 points에 적용했으므로 left, top, angle, scale 모두 리셋 (이중 변환 방지)
|
||||||
|
this.set({
|
||||||
|
left: newPathOffset.x,
|
||||||
|
top: newPathOffset.y,
|
||||||
|
angle: 0,
|
||||||
|
scaleX: 1,
|
||||||
|
scaleY: 1,
|
||||||
|
})
|
||||||
|
|
||||||
this.setCoords()
|
this.setCoords()
|
||||||
this.initLines()
|
this.initLines()
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user