Skip to content

samples/hidpi: add live mouse coordinate readout - #582

Open
pusewicz wants to merge 1 commit into
RandyGaul:masterfrom
pusewicz:hidpi-sample-mouse-readout
Open

samples/hidpi: add live mouse coordinate readout#582
pusewicz wants to merge 1 commit into
RandyGaul:masterfrom
pusewicz:hidpi-sample-mouse-readout

Conversation

@pusewicz

@pusewicz pusewicz commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Adds a mouse: screen (x, y) -> world (x, y) readout line to the hidpi sample, next to the existing pixel_scale line -- so HiDPI mouse-coordinate mapping can be eyeballed against known shape positions at any pixel scale, not just glyph/shape crispness.

Second slice of the #579 split -- pure sample addition, no engine changes.

Note: The scale of the rendered content is incorrect, which will be fixed in the upcoming PRs.

hidpi_after

Copilot AI lite review requested due to automatic review settings August 17, 2026 22:55

Copilot AI 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.

Pull request overview

Adds an on-screen diagnostic line to the hidpi sample to display the current mouse position in both screen coordinates and the corresponding world-space position via cf_screen_to_world, making it easier to visually validate HiDPI mouse-coordinate mapping against known drawn geometry.

Changes:

  • Add a live mouse: screen (x, y) -> world (x, y) readout rendered near the existing pixel_scale readout.
  • Extend the sample header comment to describe the new diagnostic output.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Shows raw screen coordinates next to cf_screen_to_world's translation,
so the HiDPI mouse mapping can be eyeballed against known shape
positions at any pixel scale.
@pusewicz
pusewicz force-pushed the hidpi-sample-mouse-readout branch from 732c101 to 662f7ca Compare August 20, 2026 10:08
@pusewicz

Copy link
Copy Markdown
Contributor Author

@RandyGaul this adds extra info about the mouse coords to the hide sample.

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