|
|
@ -489,11 +489,14 @@ export class ElementState implements LayerElement { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
applyRotate = (event: OnRotate) => { |
|
|
|
applyRotate = (event: OnRotate) => { |
|
|
|
const absoluteRotationDegree = event.absoluteRotation; |
|
|
|
const rotationDelta = event.delta; |
|
|
|
|
|
|
|
|
|
|
|
const placement = this.options.placement!; |
|
|
|
const placement = this.options.placement!; |
|
|
|
|
|
|
|
const placementRotation = placement.rotation ?? 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const calculatedRotation = placementRotation + rotationDelta; |
|
|
|
|
|
|
|
|
|
|
|
// Ensure rotation is between 0 and 360
|
|
|
|
// Ensure rotation is between 0 and 360
|
|
|
|
placement.rotation = absoluteRotationDegree - Math.floor(absoluteRotationDegree / 360) * 360; |
|
|
|
placement.rotation = calculatedRotation - Math.floor(calculatedRotation / 360) * 360; |
|
|
|
event.target.style.transform = event.transform; |
|
|
|
event.target.style.transform = event.transform; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|