From 3d660885e03e1adbedc05a2e0861535e4662e51f Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Wed, 30 Jun 2021 15:02:07 -0600 Subject: [PATCH] Fix crazy scrollbars all the time --- js/drawtools.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/js/drawtools.js b/js/drawtools.js index 9e1d37e..97e9f2e 100644 --- a/js/drawtools.js +++ b/js/drawtools.js @@ -115,8 +115,8 @@ function enableGuideBox(image, scalecorrectionfactor) { if (typeof scalecorrectionfactor == "undefined") { scalecorrectionfactor = 1; } - // disable first to clear contents - disableGuideBox(); + var context = $("#placementguidebox")[0].getContext('2d'); + context.clearRect(0, 0, $("#placementguidebox")[0].width, $("#placementguidebox")[0].height); $("#placementguidebox").css("display", ""); // calculate size of guide image var pageWidthPx = $("#page-canvas-container .page-canvas")[0].getContext("2d").canvas.width; @@ -161,4 +161,8 @@ function getMousePos(canvas, evt) { x: (evt.clientX - rect.left) * scaleX, // scale mouse coordinates after they have y: (evt.clientY - rect.top) * scaleY // been adjusted to be relative to element } -} \ No newline at end of file +} + +// Hide it at start +// doesn't work in CSS because of reasons +disableGuideBox(); \ No newline at end of file