fix(ui): the pointer in the renderer's pixels - macOS reports it in window points, so on Retina every hit landed at half the cursor's position
The old kit read Input.mouse_x() * gl_scale; ludic.ui read it raw against a layout sized in drawable pixels. A backend says how many screen pixels one pointer unit is (pointer_scale); render3d's is gl_pixel_scale(), 1 on Windows and headless. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5df0747642
commit
40a91f39ed
3 changed files with 12 additions and 2 deletions
|
|
@ -14,6 +14,7 @@ export property UiBackend {
|
|||
clip: fn(float, float, float, float) -> void = null
|
||||
unclip: fn() -> void = null
|
||||
scale: fn() -> float = null # screen pixels per design pixel
|
||||
pointer_scale: fn() -> float = null # screen pixels per unit of Input.mouse_x/y (2 on Retina)
|
||||
translate: fn(string) -> string = null # the program's language, for every text a template shows
|
||||
sound: fn(string) -> void = null # a control was used: "click", or its sound="..."
|
||||
read: fn(string) -> string = null # a template file's text (else Fs.read_text)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue