Skip to content

rust: Port the scene coordinate conversion in obs-scene.c to obs-scene #1645

Closed

Description

@nathan-v

Unit

nudge_abs_values, pos_to_absolute, pos_from_absolute, size_to_absolute, size_from_absolute, item_canvas_scale, and item_relative_scale in libobs/obs-scene.c.h, to obs-scene.

Phase and position

Phase 6, tracked by #444. After bounds placement (#1637). That port left absolute versus relative here, because size_to_absolute reads the scene's canvas.

Dependencies and existing tests

Depends on the canvas size the scene already has (get_scene_dimensions stays in obs-scene.c.h). No cmocka test covers this math. The characterization lands first: move the conversion into its own C file and pin the current behavior. No Rust in that PR.

Callers that stay in obs-scene.c.h: bounds placement's absolute step, group transform, save and load, and the position, scale, and bounds getters.

Notes

Header-inline today. The move keeps the same math. The scene still decides the canvas width and height, whether to nudge onto a half pixel (a group item, or an item whose parent is a group, does not nudge), and whether a group or nested scene keeps its scale. No SIMD. No intentional differences in the characterization. The Rust port follows in a later PR.

Activity

  1. nathan-v commented on Oct 21, 2026

    @nathan-v
    ContributorAuthor

    Claiming: scene absolute/relative coordinates (nudge_abs_values, pos_to_absolute, pos_from_absolute, size_to_absolute, size_from_absolute, item_canvas_scale, and item_relative_scale in libobs/obs-scene.c.h)

    1. This PR moves that math into obs-scene-coords.c.h and adds a cmocka test that pins the current C behavior. No Rust. The scene still reads the canvas size, and it still decides the nudge and the keep-scale early return.
    2. After that merges, the Rust port into obs-scene: RED on stubs, then GREEN, the shim, and the Tier 3 differential.

    First PR today.

  2. added
    claimed
    on Oct 21, 2026
  3. nathan-v commented on Oct 21, 2026

    @nathan-v
    ContributorAuthor

    Characterization PR is up: #1647

    C move into obs-scene-coords.c.h, plus test_scene_coords. No Rust. The Rust port is the rest of this claim.

  4. nathan-v commented on Oct 21, 2026

    @nathan-v
    ContributorAuthor

    Port draft is up: #1651

    Stacked on #1647. RED e280ff58b (8 panics, not yet implemented). GREEN 91f83df06. It stays a draft until CI is green.

  5. added a commit that references this issue on Oct 21, 2026
    808361a
  6. added a commit that references this issue on Oct 21, 2026
    8bd52ed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    claimed

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions