mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-27 08:38:12 +08:00
Fix bug in last commit that broke when scrolling on SVG elements
This commit is contained in:
@@ -106,7 +106,7 @@ export async function onMouseScroll(e: WheelEvent) {
|
|||||||
const target = e.target && (e.target as HTMLElement);
|
const target = e.target && (e.target as HTMLElement);
|
||||||
const inCanvas = target && target.closest(".canvas");
|
const inCanvas = target && target.closest(".canvas");
|
||||||
|
|
||||||
const horizontalScrollableElement = e.target instanceof HTMLElement && e.target.closest(".scrollable-x");
|
const horizontalScrollableElement = e.target instanceof Element && e.target.closest(".scrollable-x");
|
||||||
if (horizontalScrollableElement && e.deltaY !== 0) {
|
if (horizontalScrollableElement && e.deltaY !== 0) {
|
||||||
horizontalScrollableElement.scrollTo(horizontalScrollableElement.scrollLeft + e.deltaY, 0);
|
horizontalScrollableElement.scrollTo(horizontalScrollableElement.scrollLeft + e.deltaY, 0);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user