Koen van Staveren
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
6 additions and
3 deletions
-
src/canvas/index.ts
-
src/commands/view/Resize.ts
|
|
|
@ -485,9 +485,12 @@ export default class CanvasModule extends Module<CanvasConfig> { |
|
|
|
addLeft = frameRect.left || 0; |
|
|
|
} |
|
|
|
|
|
|
|
const zoom = this.getZoomDecimal(); |
|
|
|
const zoomOffset = 1 / zoom; |
|
|
|
|
|
|
|
return { |
|
|
|
y: e.clientY + addTop - yOffset, |
|
|
|
x: e.clientX + addLeft - xOffset, |
|
|
|
y: (e.clientY + addTop - yOffset) * zoomOffset, |
|
|
|
x: (e.clientX + addLeft - xOffset) * zoomOffset, |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -10,7 +10,7 @@ export default { |
|
|
|
appendTo: canvas.getResizerEl(), |
|
|
|
prefix: editor.getConfig().stylePrefix, |
|
|
|
posFetcher: canvasView.getElementPos.bind(canvasView), |
|
|
|
mousePosFetcher: canvas.getMouseRelativePos, |
|
|
|
mousePosFetcher: canvas.getMouseRelativePos.bind(canvas), |
|
|
|
...(opt.options || {}), |
|
|
|
}; |
|
|
|
let { canvasResizer } = this; |
|
|
|
|