Repository navigation
obs-scene: Port scene coordinate conversion - #1651
Merged
Merged
Conversation
Tier 1 mirrors test_scene_coords. The core is todo!() until the port. soldr cargo test -p obs-data --test obs-tests-core scene::coords fails 8 tests, each panicking not yet implemented.
The safe core matches obs-scene-coords.c.h. The nine shims stay hidden. The scene still reads the canvas and still decides nudge and keep-scale. The C file moves to libobs.ported-scene-coords. Tier 1 scene::coords is 8/8. Tier 3 parity is 3/3, including a proptest over every f32 bit pattern. Dropping the nudge's + 0.5 failed cmocka_cases_match_oracle: rust (0, 0.5), oracle (0.5, 1). Reverted. No intentional differences. Fixes obs-rust#1645
nathan-v
force-pushed
the
port/scene-coords
branch
from
October 21, 2026 20:06
91f83df to
808361a
Compare
zackees
approved these changes
Oct 21, 2026
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.
Fixes #1645
What and why
The scene coordinate conversion now lives in
obs-scene::coords. Position, size, the half-pixel nudge, and the canvas scale matchobs-scene-coords.c.h. The scene still reads the canvas withget_scene_dimensions. It still decides whether to nudge, and whether a group or a nested scene keeps its scale. Those wrappers stay inobs-scene.c.h.The nine shims are not
EXPORT. They are hidden the same wayobs_bounds_fit_scaleis. The C file moves fromlibobs.scene-coordstolibobs.ported-scene-coords, so hybridlibobslinks the Rust shims and the C reference keeps the original file.test_scene_coordsstill compilesobs-scene-coords.c.hinto itself. That cmocka test does not see the swap. Tier 3 does.Kept, characterized, not endorsed: positive half-pixel ties go up, negative ties go toward zero, and the way back does not nudge. No intentional differences.
RED → GREEN
701935691:soldr cargo test -p obs-data --test obs-tests-core scene::coordsfailed 8 tests. Each panickednot yet implemented(nudge_abs_rounds_to_a_half,nudge_skips_a_group,keep_scale_for_a_group_or_nested_scene,pos_to_absolute_on_a_1080p_canvas,pos_to_absolute_nudge_moves_a_quarter,pos_from_absolute_does_not_nudge,size_to_absolute_and_back,canvas_scale_follows_the_height).808361a42: those 8 passed. Tier 3scene::coords::paritypassed 3/3, includingrandom_inputs_match_oracleover everyf32bit pattern. Dropping the nudge's+ 0.5failedcmocka_cases_match_oracle(nudge_abs: rust(0, 0.5), oracle(0.5, 1)). Reverted.soldr cargo clippy -p obs-scene -p obs-c-oracle -p obs-data --all-targets -- -D warningspassed.ci/test_build_groups.pyandci/test_ported_sources.pypassed. The threeexport_listtests inobs-utilpassed../lintwas not run. On this Mac it stops in pre-existing host tests. No stamp. Docker Tier 2 was not run here. PR CI runs it.Checklist
master(or the description starts with a Stacked: note)docs/features.mdis added or updated (not applicable: no user-visible change)-W..., ratchets): built with scripting ON (PR CI builds no OBS app: rungh workflow run ci.yml --ref <branch>for the full builds) and cross-checked with clang and MSVC (not applicable: no flag change)