Skip to content

Commit 882beee

Browse files
committed
🚸 可以选中多个图片,使用ctrl+滚轮键统一缩放大小了
1 parent 83a9839 commit 882beee

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

app/src/core/service/controlService/controller/concrete/ControllerImageScale.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Vector } from "../../../../dataStruct/Vector";
22
import { Renderer } from "../../../../render/canvas2d/renderer";
33
import { StageManager } from "../../../../stage/stageManager/StageManager";
4+
import { ImageNode } from "../../../../stage/stageObject/entity/ImageNode";
45
import { Controller } from "../Controller";
56
import { ControllerClass } from "../ControllerClass";
67

@@ -14,11 +15,13 @@ ControllerImageScale.mousewheel = (event: WheelEvent) => {
1415
return;
1516
}
1617
// 需要注意缩放逻辑和视野缩放逻辑保持一致性
17-
if (event.deltaY > 0) {
18-
// 放大图片
19-
hoverImageNode.scaleUpdate(-0.1);
20-
} else if (event.deltaY < 0) {
21-
hoverImageNode.scaleUpdate(+0.1);
18+
for (const imageNode of StageManager.getSelectedEntities().filter((entity) => entity instanceof ImageNode)) {
19+
if (event.deltaY > 0) {
20+
// 放大图片
21+
imageNode.scaleUpdate(-0.1);
22+
} else if (event.deltaY < 0) {
23+
imageNode.scaleUpdate(+0.1);
24+
}
2225
}
2326
}
2427
};

0 commit comments

Comments
 (0)