Skip to content

Commit

Permalink
Small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Feb 4, 2025
1 parent 2ffbffd commit 79274bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions packages/core/src/canvas/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,9 @@ export default class CanvasModule extends Module<CanvasConfig> {
*/
getMouseRelativeCanvas(ev: MouseEvent | { clientX: number; clientY: number }, opts: any) {
const zoom = this.getZoomDecimal();
const canvasPos = this.getCanvasView().getPosition(opts) ?? { top: 0, left: 0 };
const canvasScroll = this.getCanvasView().getCanvasScroll();
const canvasView = this.getCanvasView();
const canvasPos = canvasView.getPosition(opts) ?? { top: 0, left: 0 };
const canvasScroll = canvasView.getCanvasScroll();
const { top, left } = {
top: canvasPos.top + canvasScroll.scrollTop,
left: canvasPos.left + canvasScroll.scrollLeft,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/canvas/view/CanvasView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -689,9 +689,9 @@ export default class CanvasView extends ModuleView<Canvas> {
this.toolsGlobEl = el.querySelector(`.${ppfx}tools-gl`)!;
this.spotsEl = el.querySelector('[data-spots]')!;
this.cvStyle = el.querySelector('[data-canvas-style]')!;
this.el.className = getUiClass(em, this.className);
el.className = getUiClass(em, this.className);
if (config.scrollableCanvas === true) {
$el.css('overflow', 'auto');
el.style.overflow = 'auto';
}
this.ready = true;
this._renderFrames();
Expand Down

0 comments on commit 79274bb

Please sign in to comment.