mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-25 16:34:06 +01:00
This commit is contained in:
parent
092035c564
commit
a9e10886c6
3 changed files with 23 additions and 23 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import {Constants} from "../constants";
|
||||
import {pathPosix} from "../util/pathName";
|
||||
import {getAllModels} from "../layout/getAll";
|
||||
|
||||
export const renderAssetsPreview = (pathString: string) => {
|
||||
if (!pathString) {
|
||||
|
|
@ -16,3 +17,23 @@ export const renderAssetsPreview = (pathString: string) => {
|
|||
return pathString;
|
||||
}
|
||||
};
|
||||
|
||||
export const pdfResize = () => {
|
||||
getAllModels().asset.find(item => {
|
||||
const pdfInstance = item.pdfObject
|
||||
const {pdfDocument, pdfViewer} = pdfInstance
|
||||
if (!pdfDocument) {
|
||||
return
|
||||
}
|
||||
const currentScaleValue = pdfViewer.currentScaleValue
|
||||
if (
|
||||
currentScaleValue === 'auto' ||
|
||||
currentScaleValue === 'page-fit' ||
|
||||
currentScaleValue === 'page-width'
|
||||
) {
|
||||
// Note: the scale is constant for 'page-actual'.
|
||||
pdfViewer.currentScaleValue = currentScaleValue
|
||||
}
|
||||
pdfViewer.update()
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue