You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sokol_android: setScreenHeight should use design height, not actual framebuffer height #158
backends/sokol/templates/mobile.txt passes the runtime actual_h from window.height() to g.setScreenHeight() in the frame() callback:
// mobile.txt — brokenconstactual_h=window.height();
BackendGfxType.setScreenSize(actual_w, actual_h);
g.setScreenHeight(@floatFromInt(actual_h)); // ← should use design height
On Android with high_dpi = false (sokol default), window.height() returns half the physical pixel height (e.g. 540 on a 1080px screen). The renderer uses this as its logical screen height, so renderer.toScreenY(design_h) computes a negative value and screen-space background sprites appear off-screen.
Fix
The template already declares screen_h: u32 = {{height}} (the project design height). Use it for setScreenHeight while setScreenSize continues to receive the actual framebuffer dimensions:
// mobile.txt — fixedconstactual_w=window.width();
constactual_h=window.height();
BackendGfxType.setScreenSize(actual_w, actual_h); // gfx backend: actual pixels for NDCg.setScreenHeight(@as(f32, @floatFromInt(screen_h))); // renderer: design height for world→screen Y
File
backends/sokol/templates/mobile.txt, line 30.
Impact
All Android projects using the sokol backend where screen-space (background/UI) sprites are positioned using the design height.
Fix landed in labelle-toolkit/labelle-assembler#24 after the sokol backend was ejected from labelle-cli to labelle-assembler (via #150). Verified on current assembler main:
Activity
fix(sokol/android): camera Y-convention and design height for setScre…
apotema commentedon Apr 17, 2026
Fix landed in labelle-toolkit/labelle-assembler#24 after the sokol backend was ejected from labelle-cli to labelle-assembler (via #150). Verified on current assembler
main:backends/sokol/src/gfx.zig:208-219(toNdcY uses(py - cam.target.y) * cam.zoom + cam.offset.y)backends/sokol/templates/mobile.txt:42(g.setScreenHeight(@floatFromInt(screen_h)))window.zig:130(high_dpi = true),mobile.txt:41(setDesignSize),mobile.txt:48(zoom = actual_h/design_h),mobile.txt:52(frameDuration()dt)ci: build labelle-assembler from the #217 branch for delegation tests
ci: track labelle-assembler main now that #217 landed there
Make labelle-cli a thin driver over the assembler binary (#217) (#221)