Skip to content

[WIP] feat: pixel ratio support#146

Open
fand wants to merge 4 commits intoratatui:mainfrom
fand:feat/pixel-ratio
Open

[WIP] feat: pixel ratio support#146
fand wants to merge 4 commits intoratatui:mainfrom
fand:feat/pixel-ratio

Conversation

@fand
Copy link

@fand fand commented Jan 10, 2026

This PR adds support for high pixel ratio rendering.
It allows us to get crisper output in HiDPI environments like Retina MacBook or iPhone.

This PR depends on the new APIs added in junkdog/beamterm#69 .
We cannot merge this until it's shipped first.

Changes

  • Add WebGL2BackendOptions.enable_auto_pixel_ratio()

When enabled, it checks the pixel ratio on every render to detect window changes.
It then calls Beamterm::set_pixel_ratio() to update WebGL viewport pixel ratio if necessary.

Screenshots

I took screenshots in demo2:

before

image

after

image

We can see the text and edges are sharper in the 2nd screenshot.

@fand fand changed the title feat: pixel ratio support [WIP] feat: pixel ratio support Jan 10, 2026
@fand fand marked this pull request as draft January 10, 2026 10:20
@fand fand force-pushed the feat/pixel-ratio branch from 98b449e to 04afb32 Compare January 11, 2026 09:04
@fand fand marked this pull request as ready for review January 11, 2026 09:10
@fand fand changed the title [WIP] feat: pixel ratio support feat: pixel ratio support Jan 11, 2026
@fand fand force-pushed the feat/pixel-ratio branch from 04afb32 to 3db4c08 Compare January 11, 2026 09:35
@fand fand changed the title feat: pixel ratio support [WIP] feat: pixel ratio support Jan 11, 2026
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.

1 participant