Skip to content

Commit

Permalink
[thumbnails-orientation] Fix scroll coordinates (ShowPage)
Browse files Browse the repository at this point in the history
  • Loading branch information
belozertsev committed Feb 13, 2025
1 parent b579913 commit 4eff3b4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions slide/Drawing/DrawingDocument.js
Original file line number Diff line number Diff line change
Expand Up @@ -5117,9 +5117,14 @@ function CThumbnailsManager(editorPage)

if (startCoord < 0) {
const size = endCoord - startCoord;
scrollTo(pageNum * size + (pageNum + 1) * this.const_border_w);
const shouldReversePageIndexes = this.m_oWordControl.isRTL &&
this.m_oWordControl.thumbnailsPosition === thumbnailsPositionMap.bottom;
const pos = shouldReversePageIndexes
? (size + this.const_border_w) * (this.m_arrPages.length - pageNum - 1)
: (size + this.const_border_w) * pageNum;
scrollTo(pos);
} else if (endCoord > visibleAreaSize) {
scrollBy(endCoord - visibleAreaSize);
scrollBy(endCoord + this.const_border_w - visibleAreaSize);
}
};

Expand Down Expand Up @@ -6231,7 +6236,7 @@ function CThumbnailsManager(editorPage)
}
wordControl.m_oScrollThumb_.isHorizontalScroll = isHorizontalOrientation;

if (wordControl.isRTL && isHorizontalOrientation) {
if (wordControl.isRTL && isHorizontalOrientation && this.m_dScrollY_max === 0) {
wordControl.m_oScrollThumbApi.scrollToX(wordControl.m_oScrollThumbApi.maxScrollX);
}
}
Expand Down

0 comments on commit 4eff3b4

Please sign in to comment.