auto: 2026-08-29 16:53 (EOMSANGDON-HOME)

This commit is contained in:
2026-08-29 16:53:18 +09:00
parent 45c6f9aa07
commit 6027e76eaf
2 changed files with 4 additions and 9 deletions
@@ -69,6 +69,7 @@ export class ScreenCanvasDrawController implements DrawController {
}
public setScreenScale(newScreenScale: number) {
console.log(`set screen scale: ${newScreenScale}`);
this.screenScale = newScreenScale;
triggerReactUpdate(StateVariable.screenZoom);
}
@@ -106,14 +107,13 @@ export class ScreenCanvasDrawController implements DrawController {
* This function takes the deltaY from the mouse wheel event and zooms the screen in or out
* The location of the mouse in world space is preserved
* @param deltaY
* @param strength 한 번에 얼마나 확대할지(휠 한 칸 = 1). 트랙패드의 잔 델타용.
*/
public zoomScreen(deltaY: number, strength = 1) {
public zoomScreen(deltaY: number) {
const worldMouseLocationBeforeZoom = this.getWorldMouseLocation();
const oldScreenScale = this.getScreenScale();
const newScreenScale =
oldScreenScale * (1 - MOUSE_ZOOM_MULTIPLIER * strength * (deltaY / Math.abs(deltaY)));
oldScreenScale * (1 - MOUSE_ZOOM_MULTIPLIER * (deltaY / Math.abs(deltaY)));
this.setScreenScale(newScreenScale);
// now get the location of the cursor in world space again