Skip to content

test: Characterize the scene group transform - #1722

Merged
zackees merged 2 commits into
obs-rust:masterfrom
nathan-v:test/scene-group-transform
Oct 22, 2026
Merged

zackees merged 2 commits into
obs-rust:masterfrom
nathan-v:test/scene-group-transform

Conversation

@nathan-v

Copy link
Copy Markdown
Contributor

Refs #1719

What and why

The group transform math in obs-scene.c.h moves out before the Rust port. transform_val, and the matrix half of get_ungrouped_transform and apply_group_transform, go into obs-scene-group-transform.c.h. The scene still reads the item. It still converts absolute and relative coordinates, because that needs the canvas. It still inverts the group's draw transform when an item joins a group, and it still calls update_item_transform. calculate_bounds_data is unchanged.

The new file is its own unity group, libobs.scene-group-transform, on LIBOBS_SOURCES. It stays C. The port, later, moves the include into a ported group.

The new symbols are not exported. test_scene_group_transform compiles obs-scene-group-transform.c.h and pins the current C. No display. It characterizes that C source, so a later Rust swap stays invisible until the symbols are reachable from the test.

Characterized, not endorsed (comments in the test and the header):

  • A scale that is not greater than zero takes the minus sign. The length of a zero column is positive zero, so a zero scale becomes negative zero. An input of negative zero stays negative zero.
  • A rotation in the matrix moves the point. Scale is the column length, so a pure rotation leaves the scale alone. The child's rotation is only rot_delta.
  • The original writes x_base and never reads it. That write stays, so the body matches.

RED → GREEN

  • RED commit: none. This is the move and the characterization. The port follows on rust: Port the scene group transform in obs-scene.c to obs-scene #1719.
  • 37110fbb1 libobs: Move the scene group transform out
  • 5861db987 test: Characterize the scene group transform. test_scene_group_transform 7/7. Compiled -Wall -Wextra -Werror and linked against the existing macOS libobs.framework (ENABLE_RUST_LIBOBS=OFF). The Xcode project was not reconfigured.
  • The scene unity TU (libobs.core-source) compiles with that same response file. ci/test_build_groups.py passed (6 tests). clang-format 22.1.3 and gersemi 0.25.0 were applied to the new files.
  • ./lint was not run. No stamp. Docker Tier 2 was not run here. PR CI runs it.
  • Real app: no behavior change.

Checklist

  • Base is master (or the description starts with a Stacked: note)
  • I claimed the issue, or no one else has an open PR for it
  • Characterization test (if the unit had none), then RED, then GREEN commits (this is the extraction and its characterization; the port follows)
  • User-visible change: its line in docs/features.md is added or updated (not applicable: no user-visible change)
  • (Optional) Local gate passed and the pushed head is stamped; otherwise PR CI runs the full suite
  • Warning or flag changes (-W..., ratchets): built with scripting ON (PR CI builds no OBS app: run gh workflow run ci.yml --ref <branch> for the full builds) and cross-checked with clang and MSVC (not applicable: no flag change)
  • Intentional differences from C listed in the parity test header and rust/README.md (ports): not applicable (no port here)

transform_val and the matrix half of the group transform now live
in obs-scene-group-transform.c.h. The scene still converts absolute
and relative coordinates, still inverts the draw transform when an
item joins a group, and still calls update_item_transform. Same
behavior.

Refs obs-rust#1719
The symbols are not exported, so the test compiles the C and pins
what it does today. A zero scale becomes negative zero. A rotation
in the matrix does not change the scale. No display.

Refs obs-rust#1719
@nathan-v
nathan-v requested a review from zackees as a code owner October 22, 2026 05:18
@nathan-v nathan-v mentioned this pull request Oct 22, 2026
6 of 7 tasks
@zackees
zackees added this pull request to the merge queue Oct 22, 2026
Merged via the queue into obs-rust:master with commit 8534113 Oct 22, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants