diff --git a/frontend/src/builder.d.ts b/frontend/src/builder.d.ts index f2ae2e58..e6474767 100644 --- a/frontend/src/builder.d.ts +++ b/frontend/src/builder.d.ts @@ -68,7 +68,7 @@ declare type HashString = `#${string}`; declare type RGBString = `rgb(${number}, ${number}, ${number})`; -declare type LeftSidebarTabOption = "Blocks" | "Layers" | "Assets"; +declare type LeftSidebarTabOption = "Blocks" | "Layers" | "Assets" | "Code"; declare type RightSidebarTabOption = "Properties" | "Script" | "Options"; declare type BuilderMode = "select" | "text" | "container" | "image" | "repeater" | "move"; diff --git a/frontend/src/components/BlockProperties.vue b/frontend/src/components/BlockProperties.vue index fd606850..dce8b7de 100644 --- a/frontend/src/components/BlockProperties.vue +++ b/frontend/src/components/BlockProperties.vue @@ -1,6 +1,6 @@ diff --git a/frontend/src/utils/panAndZoom.ts b/frontend/src/utils/panAndZoom.ts index d2416214..8e3b6d43 100644 --- a/frontend/src/utils/panAndZoom.ts +++ b/frontend/src/utils/panAndZoom.ts @@ -34,9 +34,22 @@ function setPanAndZoom( }; panAndZoomAreaElement.addEventListener("mousemove", clearPinchPoint, { once: true }); } - // Multiplying with 0.01 to make the zooming less sensitive + + let sensitivity = 0.008; + function tooMuchScroll() { + if (e.deltaY > 30 || e.deltaY < -30) { + return true; + } + } + if (tooMuchScroll()) { + // If the user scrolls too much, reduce the sensitivity + // this mostly happens when the user uses mouse wheel to scroll + // probably not the best way to handle this, but works for now + sensitivity = 0.001; + } + // Multiplying with scale to make the zooming feel consistent - let scale = props.scale - e.deltaY * 0.008 * props.scale; + let scale = props.scale - e.deltaY * sensitivity * props.scale; scale = Math.min(Math.max(scale, zoomLimits.min), zoomLimits.max); props.scale = scale; nextTick(() => {