kopia lustrzana https://github.com/miklobit/TiddlyWiki5
Fix tc-adjust-top-of-scroll (#3475)
* correct scrolling with tc-adjust-top-of-scroll not multiplying `offset` with t causes jumps at the first animation steps, where the offset value is bigger than `endY - scrollPosition.y` * correct scroll offsetlogging-improvements
rodzic
16eb5e1e32
commit
4d1127ed5b
|
@ -71,7 +71,7 @@ PageScroller.prototype.scrollIntoView = function(element) {
|
|||
scrollPosition = $tw.utils.getScrollPosition();
|
||||
return {
|
||||
left: clientBounds.left + scrollPosition.x,
|
||||
top: clientBounds.top + scrollPosition.y,
|
||||
top: clientBounds.top + scrollPosition.y - offset,
|
||||
width: clientBounds.width,
|
||||
height: clientBounds.height
|
||||
};
|
||||
|
@ -104,7 +104,7 @@ PageScroller.prototype.scrollIntoView = function(element) {
|
|||
bounds = getBounds(),
|
||||
endX = getEndPos(bounds.left,bounds.width,scrollPosition.x,window.innerWidth),
|
||||
endY = getEndPos(bounds.top,bounds.height,scrollPosition.y,window.innerHeight);
|
||||
window.scrollTo(scrollPosition.x + (endX - scrollPosition.x) * t,scrollPosition.y + (endY - scrollPosition.y - offset) * t);
|
||||
window.scrollTo(scrollPosition.x + (endX - scrollPosition.x) * t,scrollPosition.y + (endY - scrollPosition.y) * t);
|
||||
if(t < 1) {
|
||||
self.idRequestFrame = self.requestAnimationFrame.call(window,drawFrame);
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue