From b6bee303a9934a2be9e83edea431825a15a9dd91 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 23 Jul 2013 16:57:30 -0500 Subject: [PATCH] fix scroll obfuscation. --- lib/widget.js | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/lib/widget.js b/lib/widget.js index c3052d5..8c02a9e 100644 --- a/lib/widget.js +++ b/lib/widget.js @@ -2656,30 +2656,24 @@ Box.prototype._getCoords = function(get) { ryl = yl - el._getTop(get) - el.ibottom; visible = el._getHeight(get) - el.iheight; - // if (ryi < el.childBase) { - // if (ryl > el.childBase) { - // // Is partially covered above. - // v = ryl - el.childBase; - // yi += (ryl - ryi) - v; - // } else { - // // Is above. - // return; - // } - // } else if (ryi >= el.childBase + visible) { - // // Is below. - // return; - // } else if (ryl >= el.childBase + visible) { - // // Is partially covered below. - // v = el.childBase + visible + (yl - yi) - ryl; - // yl = yi + v; - // } - if (ryi < el.childBase) { - // Is above. - return; + if (ryl > el.childBase) { + // Is partially covered above. + v = ryl - el.childBase; + yi += (ryl - ryi) - v; + return; + } else { + // Is above. + return; + } } else if (ryi >= el.childBase + visible) { // Is below. return; + } else if (ryl > el.childBase + visible) { + // Is partially covered below. + v = el.childBase + visible + (yl - yi) - ryl; + yl = yi + v; + return; } yi -= el.childBase;