Improve scroll into view

- if a node is behind scrollbar, it is not scrolled into view
- jQuery `.width()` & `.width()` actually includes the scroll bar.
- using native `clientWidth` and `clientHeight` fixes this
This commit is contained in:
Steve-Mcl 2022-03-04 16:08:29 +00:00
parent c0612e6193
commit cf1424976f
1 changed files with 1 additions and 1 deletions

View File

@ -5621,7 +5621,7 @@ RED.view = (function() {
node.dirty = true;
RED.workspaces.show(node.z);
var screenSize = [chart.width()/scaleFactor,chart.height()/scaleFactor];
var screenSize = [chart[0].clientWidth/scaleFactor,chart[0].clientHeight/scaleFactor];
var scrollPos = [chart.scrollLeft()/scaleFactor,chart.scrollTop()/scaleFactor];
var cx = node.x;
var cy = node.y;