fix: image horizontal flip fix + improved tests (#5799)

Co-authored-by: Antonio Della Fortuna <a.dellafortuna00@gmail.com>
Co-authored-by: dwelle <luzar.david@gmail.com>
fixes https://github.com/excalidraw/excalidraw/issues/5784
This commit is contained in:
Antonio Della Fortuna 2023-01-08 17:19:13 +01:00 committed by GitHub
parent 809d5ba17f
commit 06b45e0cfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 621 additions and 507 deletions

View File

@ -557,10 +557,10 @@ export const resizeSingleElement = (
mutateElement(element, { mutateElement(element, {
scale: [ scale: [
// defaulting because scaleX/Y can be 0/-0 // defaulting because scaleX/Y can be 0/-0
(Math.sign(scaleX) || stateAtResizeStart.scale[0]) * (Math.sign(newBoundsX2 - stateAtResizeStart.x) ||
stateAtResizeStart.scale[0], stateAtResizeStart.scale[0]) * stateAtResizeStart.scale[0],
(Math.sign(scaleY) || stateAtResizeStart.scale[1]) * (Math.sign(newBoundsY2 - stateAtResizeStart.y) ||
stateAtResizeStart.scale[1], stateAtResizeStart.scale[1]) * stateAtResizeStart.scale[1],
], ],
}); });
} }

File diff suppressed because it is too large Load Diff