mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-30 01:27:26 +08:00
1 parent
010baf3370
commit
a29b37ddef
1 file changed
+2
-2
@@ -12094,7 +12094,7 @@ function fitWidth(updateStatus = true) {
|
|||||||
function fitWidthScale(page) {
|
function fitWidthScale(page) {
|
||||||
if (state.pageLayout > 1) {
|
if (state.pageLayout > 1) {
|
||||||
const size = pageGroupSize();
|
const size = pageGroupSize();
|
||||||
return Math.min(4, Math.max(1, el.viewerPanel.clientWidth - pageSpace() * 2 - (state.continuous ? 0 : PAGE_LAYOUT_GAP) - scrollbarWidth()) / (size.width * MM_TO_PX));
|
return Math.min(4, Math.max(1, el.viewerPanel.offsetWidth - pageSpace() * 2 - (state.continuous ? 0 : PAGE_LAYOUT_GAP) - scrollbarWidth()) / (size.width * MM_TO_PX));
|
||||||
}
|
}
|
||||||
page = pageViewSize(page);
|
page = pageViewSize(page);
|
||||||
const space = pageSpace();
|
const space = pageSpace();
|
||||||
@@ -12126,7 +12126,7 @@ function fitHeight(updateStatus = true) {
|
|||||||
}
|
}
|
||||||
if (state.pageLayout > 1) {
|
if (state.pageLayout > 1) {
|
||||||
const size = pageGroupSize(), space = pageSpace(), gap = state.continuous ? 0 : PAGE_LAYOUT_GAP;
|
const size = pageGroupSize(), space = pageSpace(), gap = state.continuous ? 0 : PAGE_LAYOUT_GAP;
|
||||||
const width = Math.max(1, el.viewerPanel.clientWidth - space * 2 - gap - scrollbarWidth());
|
const width = Math.max(1, el.viewerPanel.offsetWidth - space * 2 - gap - scrollbarWidth());
|
||||||
const height = Math.max(1, el.viewerPanel.clientHeight - space * 2);
|
const height = Math.max(1, el.viewerPanel.clientHeight - space * 2);
|
||||||
setScale(Math.min(width / (size.width * MM_TO_PX), height / (size.height * MM_TO_PX)), updateStatus, "height");
|
setScale(Math.min(width / (size.width * MM_TO_PX), height / (size.height * MM_TO_PX)), updateStatus, "height");
|
||||||
if (updateStatus) scrollToPage(state.pageIndex);
|
if (updateStatus) scrollToPage(state.pageIndex);
|
||||||
|
|||||||
Reference in new issue
Block a user