Skip to content

Fix Blurry issue by forcing rebuild ObjectUrl in PageRenderContext#181

Draft
huytr1995 wants to merge 1 commit into
mainfrom
Huy/Fix_Blurry
Draft

Fix Blurry issue by forcing rebuild ObjectUrl in PageRenderContext#181
huytr1995 wants to merge 1 commit into
mainfrom
Huy/Fix_Blurry

Conversation

@huytr1995

Copy link
Copy Markdown
Contributor

Description

Describe the change and its purpose. Include a ticket if applicable.

Reviewer Instructions

Anything a review needs to know about this PR to help them give better feedback. Are there specific questions you have? Are there areas you are unsure of? Does this come from or relate to another part of the codebase?

Testing Plan

Describe what you did to test the change.

Output / Screenshots

Before

What did it look like before?

After

What will it look like after merging?

A11y

How do keyboard navigation and screen readers work with this PR?

@huytr1995
huytr1995 requested a review from pauls-ai2 August 25, 2022 19:10

@pauls-ai2 pauls-ai2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like the wrong direction. isScaleChanged is effectively scale !== DEFAULT_SCALE, except it never goes back.

const viewport = pageProxy.getViewport({ scale: scale * zoomMultiplier * devicePixelRatio });
canvas.height = viewport.height;
canvas.width = viewport.width;
canvas.style.width = '100%'; //de-zoom canvas with style (maybe you can directly use CSS), reaching de-zoom of higher definition PDF

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style is meaningless when the element isn't in the DOM.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might try canvasContext.imageSmoothingEnabled = false;.

Another thing you could try is canvasContext.imageSmoothingQuality = 'high';.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants