Skip to content

Commit

Permalink
Remove scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
Kitenite committed Jun 27, 2024
1 parent cd84b89 commit fa13345
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
12 changes: 2 additions & 10 deletions electron/preload/webview/eventBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,10 @@ export class EventBridge {
'click': handleMouseEvent,
'dblclick': handleMouseEvent,
'wheel': (e: WheelEvent) => {
return {
coordinates: { x: e.deltaX, y: e.deltaY },
innerHeight: document.body.scrollHeight,
innerWidth: window.innerWidth,
}
return {}
},
'scroll': (e: Event) => {
return {
coordinates: { x: window.scrollX, y: window.scrollY },
innerHeight: document.body.scrollHeight,
innerWidth: window.innerWidth,
}
return {}
},
'dom-ready': () => {
const { body } = document;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/project/Canvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function Canvas({ children }: Canvas) {

const containerRef = useRef<HTMLDivElement>(null);
const overlayRef = useRef<HTMLDivElement>(null);
const zoomSensitivity = 0.002;
const zoomSensitivity = 0.003;
const panSensitivity = 0.4;

const handleWheel = (event: WheelEvent) => {
Expand Down
6 changes: 6 additions & 0 deletions src/routes/project/webview/WebviewArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ export class WebviewEventHandler {
overlayManager.removeClickedRects();
overlayManager.addClickRect(adjustedRect, elementMetadata.computedStyle);
},
'wheel': (e: Electron.IpcMessageEvent) => {
if (!e.args || e.args.length === 0) {
console.error('No args found for mouseover event');
return;
}
},
};
this.handleIpcMessage = this.handleIpcMessage.bind(this);
}
Expand Down

0 comments on commit fa13345

Please sign in to comment.