refboard: stabilize image flip and crop transforms

This commit is contained in:
Hiren Kangad
2026-03-13 11:21:27 +05:30
parent c40304464f
commit 12410c0098
11 changed files with 359 additions and 98 deletions
+10 -4
View File
@@ -12,6 +12,8 @@ import { TransformBox } from './TransformBox';
import { SnapGuides } from './SnapGuides';
import { ImageSprite } from './sprites/ImageSprite';
import { VideoSprite } from './sprites/VideoSprite';
import type { ImageObject } from './scene-format';
import { applyImageDisplayTransform } from './imageTransforms';
// ---------------------------------------------------------------------------
// Constants
@@ -289,10 +291,14 @@ export class SelectionManager {
// Move all selected items by corrected delta and broadcast all together
for (const item of selected) {
item.displayObject.x += ddx;
item.displayObject.y += ddy;
item.data.x = item.displayObject.x;
item.data.y = item.displayObject.y;
item.data.x += ddx;
item.data.y += ddy;
if (item.type === 'image') {
applyImageDisplayTransform(item.displayObject, item.data as ImageObject);
} else {
item.displayObject.x = item.data.x;
item.displayObject.y = item.data.y;
}
}
if (this._onItemsTransform) {
this._onItemsTransform(selected);