-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(auto-edit): Fix low resolution images on low DPI screens #7100
Conversation
f62b1a2
to
247d708
Compare
686408c
to
dd2afc1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, Added minor comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM !!
@@ -173,11 +172,15 @@ export function drawDecorationsToCanvas( | |||
const canvasWidth = Math.min(requiredWidth + config.padding.x, config.maxWidth) | |||
const canvasHeight = tempYPos + config.padding.y | |||
|
|||
// Round to the nearest pixel, using sub-pixels will cause CanvasKit to crash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting, is it expected? 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, didn't find many issues online about it either but it's hard to search because CanvasKit is just a small part of Skia which is a much bigger project (used for rendering Chrome/Android UIs etc).
Thankfully the image tests work really well here and help catch any regressions
…creens (#7112) ### Description closes https://linear.app/sourcegraph/issue/CODY-4995/image-appears-blurred-on-large-screen-compared-to-text closes https://linear.app/sourcegraph/issue/CODY-4924/auto-edit-improve-image-resolution ### Screenshots (Low DPI Display) **This is without the progressive enhancement, i.e. using the default pixel ratio of 1.95** **Before** <img width="662" alt="image" src="https://github.com/user-attachments/assets/97f11290-c41d-478f-bc8c-a95c179edc5b" /> **After** <img width="663" alt="image" src="https://github.com/user-attachments/assets/072e9822-7aaa-41fb-bd5d-65c506599d8b" /> ### Screenshots (High DPI Display) **This is without the progressive enhancement, i.e. using the default pixel ratio of 1.95** **Before** <img width="646" alt="image" src="https://github.com/user-attachments/assets/d960e8d7-5ea6-4402-a748-fab9e21869c3" /> **After** <img width="647" alt="image" src="https://github.com/user-attachments/assets/d75cb094-5314-478e-a3b9-c6897c43b569" /> ## Test plan - Tested on a low DPI display with the default pixel ratio of 1.95 - Tested on a low DPI display with the actual pixel ratio - Tested on a high DPI display with the default pixel ratio of 1.95 - Tested on a high DPI display with the actual pixel ratio <br> Backport d21d2b7 from #7100 Co-authored-by: Tom Ross <[email protected]>
Description
closes https://linear.app/sourcegraph/issue/CODY-4995/image-appears-blurred-on-large-screen-compared-to-text
closes https://linear.app/sourcegraph/issue/CODY-4924/auto-edit-improve-image-resolution
Screenshots (Low DPI Display)
This is without the progressive enhancement, i.e. using the default pixel ratio of 1.95
Before

After

Screenshots (High DPI Display)
This is without the progressive enhancement, i.e. using the default pixel ratio of 1.95
Before

After

Test plan