diff options
author | bobzel <zzzman@gmail.com> | 2021-08-26 19:17:53 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-08-26 19:17:53 -0400 |
commit | 7c83bc30b3a6ed6061ef68bcef6a0e8941668b3c (patch) | |
tree | d213c1c545b6dc88e5bacc5185d5fc1fcbb5aea3 /src/client/documents/Documents.ts | |
parent | 7a1b11bd9d71d4b414059b6cbc0ad518011f7cdd (diff) |
fixed resizing bug for web and pdf documents when doing autoheight gesture, and after opening the sidebar and then resizing
Diffstat (limited to 'src/client/documents/Documents.ts')
-rw-r--r-- | src/client/documents/Documents.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/client/documents/Documents.ts b/src/client/documents/Documents.ts index db1e67203..a1ffddb98 100644 --- a/src/client/documents/Documents.ts +++ b/src/client/documents/Documents.ts @@ -709,10 +709,20 @@ export namespace Docs { } export function PdfDocument(url: string, options: DocumentOptions = {}) { + const width = options._width || undefined; + const height = options._height || undefined; + const nwid = options._nativeWidth || undefined; + const nhght = options._nativeHeight || undefined; + if (!nhght && width && height && nwid) options._nativeHeight = Number(nwid) * Number(height) / Number(width); return InstanceFromProto(Prototypes.get(DocumentType.PDF), new PdfField(url), options); } export function WebDocument(url: string, options: DocumentOptions = {}) { + const width = options._width || undefined; + const height = options._height || undefined; + const nwid = options._nativeWidth || undefined; + const nhght = options._nativeHeight || undefined; + if (!nhght && width && height && nwid) options._nativeHeight = Number(nwid) * Number(height) / Number(width); return InstanceFromProto(Prototypes.get(DocumentType.WEB), url ? new WebField(url) : undefined, options); } |