mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-24 10:27:10 +02:00
Desktop: Fix pdf text blurry (#6843)
This commit is contained in:
parent
907dc7601b
commit
d07788607c
@ -993,6 +993,9 @@ packages/app-mobile/components/screens/UpgradeSyncTargetScreen.js.map
|
||||
packages/app-mobile/components/screens/encryption-config.d.ts
|
||||
packages/app-mobile/components/screens/encryption-config.js
|
||||
packages/app-mobile/components/screens/encryption-config.js.map
|
||||
packages/app-mobile/components/searchNotes.d.ts
|
||||
packages/app-mobile/components/searchNotes.js
|
||||
packages/app-mobile/components/searchNotes.js.map
|
||||
packages/app-mobile/components/useStyles.d.ts
|
||||
packages/app-mobile/components/useStyles.js
|
||||
packages/app-mobile/components/useStyles.js.map
|
||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -981,6 +981,9 @@ packages/app-mobile/components/screens/UpgradeSyncTargetScreen.js.map
|
||||
packages/app-mobile/components/screens/encryption-config.d.ts
|
||||
packages/app-mobile/components/screens/encryption-config.js
|
||||
packages/app-mobile/components/screens/encryption-config.js.map
|
||||
packages/app-mobile/components/searchNotes.d.ts
|
||||
packages/app-mobile/components/searchNotes.js
|
||||
packages/app-mobile/components/searchNotes.js.map
|
||||
packages/app-mobile/components/useStyles.d.ts
|
||||
packages/app-mobile/components/useStyles.js
|
||||
packages/app-mobile/components/useStyles.js.map
|
||||
|
@ -74,6 +74,10 @@ export default function Page(props: PageProps) {
|
||||
|
||||
const renderPage = async () => {
|
||||
try {
|
||||
if (canvasRef.current) {
|
||||
canvasRef.current.style.height = '100%';
|
||||
canvasRef.current.style.width = '100%';
|
||||
}
|
||||
const renderRequest: RenderRequest = {
|
||||
pageNo: props.pageNo,
|
||||
scaledSize: props.scaledSize,
|
||||
|
@ -90,6 +90,7 @@ export default class PdfDocument {
|
||||
checkCancelled();
|
||||
|
||||
const canvas = this.document.createElement('canvas');
|
||||
canvas.classList.add('page-canvas');
|
||||
const viewport = page.getViewport({ scale: scaledSize.scale || 1.0 });
|
||||
canvas.width = viewport.width;
|
||||
canvas.height = viewport.height;
|
||||
@ -124,9 +125,6 @@ export default class PdfDocument {
|
||||
textLayerDiv.appendChild(textFragment);
|
||||
}
|
||||
|
||||
canvas.style.height = '100%';
|
||||
canvas.style.width = '100%';
|
||||
|
||||
return { canvas, textLayerDiv };
|
||||
};
|
||||
|
||||
|
@ -85,3 +85,14 @@ hr {
|
||||
background-color: rgb(54, 54, 54);
|
||||
}
|
||||
|
||||
.page-canvas {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
}
|
||||
|
||||
.textLayer {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
}
|
Loading…
Reference in New Issue
Block a user