Repository navigation
build: add Windows x86_64 support - #2
Merged
Merged
Conversation
measureText("") segfaults natively and HANGS under wasm. Both land inside
skiac_canvas_get_line_metrics_or_draw_text itself, confirmed under gdb:
#0 skiac_canvas_get_line_metrics_or_draw_text ()
#1 text_run(unsigned int, unsigned int, double, double, double) ()
#2 sc_f__x25__x25_m13_Context2D_measureText ()
This is not an exotic input. Every text field measures the empty string
before the first keystroke -- that is how the caret gets positioned -- so a
wasmcart cart drawing a text-entry screen died on frame 2, and the two
symptoms diverging by platform made it look like an asyncify bug until it
bisected down to this one call. measureText("x") is fine either way.
The fix is an early return in text_run: all-zero metrics are the CORRECT
answer for an empty run, not a fallback. An empty string draws nothing,
occupies no width and has no bounding box, and g_metrics is already zeroed
on the line above. It sits ahead of the measure/draw split because drawing
an empty string is a no-op for the same reason.
textprobe gains the case, printing either side of the call so a hang and a
wrong number stay distinguishable in the log. Verified: native crashed
before, reports width=0 ascent=0 after, and measureText("q") still measures
15.23 as a control that the guard did not swallow real text.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds and verifies the Windows x86_64 build path using the MSVC ABI.
Verified by the green Windows run: https://github.com/monteslu/scriptc-game/actions/runs/30494640430