Subtract metrics.contentTop from metrics.viewTop so that the flyout does not begin to scroll down once the delta is smaller than the value of metrics.contentTop (#1309)

This commit is contained in:
Nick Allred
2017-09-18 16:21:43 -04:00
committed by RoboErikG
parent dd50dde23d
commit c5be6e1722

View File

@@ -214,7 +214,7 @@ Blockly.VerticalFlyout.prototype.wheel_ = function(e) {
delta *= 10;
}
var metrics = this.getMetrics_();
var pos = metrics.viewTop + delta;
var pos = (metrics.viewTop - metrics.contentTop) + delta;
var limit = metrics.contentHeight - metrics.viewHeight;
pos = Math.min(pos, limit);
pos = Math.max(pos, 0);