Skip to content

Commit

Permalink
fix(cropper-viewer): calculate translateY correctly when rotated 90deg (
Browse files Browse the repository at this point in the history
  • Loading branch information
optinn-henrik authored Apr 14, 2024
1 parent 163b419 commit 2dea551
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/element-viewer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export default class CropperViewer extends CropperElement {
if ($sourceImage && $image && $scale > 0) {
const [a, b, c, d, e, f] = matrix;
const translateX = ((x * d) - (c * y)) / ((a * d) - (c * b));
const translateY = (y - (b * translateX)) / d;
const translateY = ((y * a) - (b * x)) / ((a * d) - (c * b));
const newE = a * translateX + c * translateY + e;
const newF = b * translateX + d * translateY + f;

Expand Down

0 comments on commit 2dea551

Please sign in to comment.