From 10e1d6a0c365a31912328625464181f56b3d6a25 Mon Sep 17 00:00:00 2001 From: Ivica Ico Bukvic <ico@vt.edu> Date: Mon, 27 Jul 2020 18:00:12 -0400 Subject: [PATCH] Addressed the issue where optimal zoom did not update the scrollable area and reenabled the zoom of the scrollbars when zooming (this scrollbar zoom size may require further reflection to decide the best path forward). --- pd/nw/pdgui.js | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/pd/nw/pdgui.js b/pd/nw/pdgui.js index a230238ca..1476d85b4 100644 --- a/pd/nw/pdgui.js +++ b/pd/nw/pdgui.js @@ -6023,10 +6023,16 @@ function canvas_params(nw_win) vscroll.style.setProperty("height", (yHeight - 6) + "px"); vscroll.style.setProperty("top", (yScrollTopOffset + 2) + "px"); vscroll.style.setProperty("-webkit-clip-path", - "polygon(0px 0px, 5px 0px, 5px " + (yHeight - 6) + - "px, 0px " + (yHeight - 11) + "px, 0px 5px)"); - vscroll.style.setProperty("width", (5 * zoom) + "px"); - vscroll.style.setProperty("right", (2 * zoom) + "px"); + "polygon(0px 0px, 5px 0px, 5px " + (yHeight - 6 + nw_version_bbox_offset) + + "px, 0px " + (yHeight - 11 + nw_version_bbox_offset) + "px, 0px 5px)"); + // ico@vt.edu: this could go either way. We can zoom here to compensate for + // the zoom and keep the scrollbars the same size, or, as is the case with + // this new commit, we enlarge them together with the patch since one of the + // possible rationales is that zooming is there to improve visibility. If + // we decide to reenable this, we may want to fine-tune scrollbar height to + // ensure its size is accurate. + //vscroll.style.setProperty("width", (5 * zoom) + "px"); + //vscroll.style.setProperty("right", (2 * zoom) + "px"); vscroll.style.setProperty("visibility", "visible"); } else { vscroll.style.setProperty("visibility", "hidden"); @@ -6044,8 +6050,14 @@ function canvas_params(nw_win) hscroll.style.setProperty("-webkit-clip-path", "polygon(0px 0px, " + (xWidth - 11) + "px 0px, " + (xWidth - 6) + "px 5px, 0px 5px)"); - hscroll.style.setProperty("height", (5 * zoom) + "px"); - hscroll.style.setProperty("bottom", (2 * zoom) + "px"); + // ico@vt.edu: this could go either way. We can zoom here to compensate for + // the zoom and keep the scrollbars the same size, or, as is the case with + // this new commit, we enlarge them together with the patch since one of the + // possible rationales is that zooming is there to improve visibility. If + // we decide to reenable this, we may want to fine-tune scrollbar width to + // ensure its size is accurate. + //hscroll.style.setProperty("height", (5 * zoom) + "px"); + //hscroll.style.setProperty("bottom", (2 * zoom) + "px"); hscroll.style.setProperty("visibility", "visible"); } else { hscroll.style.setProperty("visibility", "hidden"); @@ -6208,6 +6220,7 @@ function do_optimalzoom(cid, hflag, vflag) { nw_win.zoomLevel = z; pdsend(cid, "zoom", z); } + do_getscroll(cid,1); }); } -- GitLab