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
bug: libobs: moving one child of a group drags its siblings across the canvas (upstream #9298) #279
Upstream OBS bug, reported by Durss in obsproject/obs-studio#9298 (confirmed upstream by RytoEX and PatTheMav). Code unchanged in this fork.
Location
libobs/obs-scene.c:3500: resize_group() moves the group to where the content's alignment anchor was, computed from the content's exact size (minv/maxv).
libobs/obs-scene.c:325 and update_item_transform(): the group draws with its alignment offset taken from its rounded size: the scene size is ceil()ed to whole pixels, scaled and truncated to an integer, and centred alignment halves it with integer division.
Class
Layout drift: moving one child of a group slowly moves its other children across the canvas.
How it is reached
Group two sources, set the group's alignment to centre (or anything with a centred axis, or bottom/right), and drag one child around in the preview. Every move changes the content bounds and resizes the group; each resize shifts the content by the rounding remainder, and the shifts add up, so the untouched child creeps away. PatTheMav measured a bottom-right anchored group moving away from its corner.
Reproduced headlessly with libobs on a 1920x1080 canvas: after 60 fractional moves of one child, the other child moved by (−0.66, −0.57) px with a centred group and by (−29.3, −30.1) px with a bottom-right group. A top-left group does not drift.
Proposed fix and failing test
Fix: instead of deriving the group's new position from the content size, note where the content's corner is with the old transform, rebuild the transform with the new size and move the group by the difference, so the content stays exactly in place whatever the rounding, alignment, scale or rotation.
RED test (cmocka, test_group_child_drift): the scenario above for centred, bottom-right and top-left groups. 2 of 3 fail today; top-left guards the fix.
RED: test_group_child_drift (2 of 3 failing): one child moved in fractional steps, the sibling measured on the canvas for centred, bottom-right and top-left groups.
GREEN: resize_group() moves the group by the measured difference so its content stays exactly in place.
PR today.
@Durss you reported this in obsproject/obs-studio#9298, so a heads-up: it's fixed here in obs-rust by #280, merged today with a regression test.
Cause, close to what PatTheMav suspected upstream: when a child moves, the group resizes and repositions itself so its content stays put, but it computed that position from the content's exact size while drawing itself with a size rounded to whole pixels (and halved with integer division for centred alignment). Every move shifted the content by the rounding remainder, and the shifts added up. Now the group measures where its content actually lands after the resize and corrects by the difference, so the other children stay exactly in place. The test moves one child 60 times in small fractional steps: before, the other child drifted by about 0.7 px with a centred group and 30 px with a bottom-right group; now it doesn't move.
Workaround on stock OBS: use top-left alignment on groups whose children you move.
obs-rust is an AI-assisted fork of OBS; on Arch it's obs-studio-rust-git in the AUR.
If you try it, a short reply here on whether your groups stay put would really help.
Activity
rdoupe commentedon Oct 11, 2026
Claiming: this issue.
test_group_child_drift(2 of 3 failing): one child moved in fractional steps, the sibling measured on the canvas for centred, bottom-right and top-left groups.resize_group()moves the group by the measured difference so its content stays exactly in place.PR today.
test: Moving a group child must not drag its siblings (RED)
test: Moving a group child must not drag its siblings (RED)
libobs: Keep group children in place when the group resizes
test: Skip my new core tests when libobs cannot start
rdoupe commentedon Oct 11, 2026
@Durss you reported this in obsproject/obs-studio#9298, so a heads-up: it's fixed here in obs-rust by #280, merged today with a regression test.
Cause, close to what PatTheMav suspected upstream: when a child moves, the group resizes and repositions itself so its content stays put, but it computed that position from the content's exact size while drawing itself with a size rounded to whole pixels (and halved with integer division for centred alignment). Every move shifted the content by the rounding remainder, and the shifts added up. Now the group measures where its content actually lands after the resize and corrects by the difference, so the other children stay exactly in place. The test moves one child 60 times in small fractional steps: before, the other child drifted by about 0.7 px with a centred group and 30 px with a bottom-right group; now it doesn't move.
Workaround on stock OBS: use top-left alignment on groups whose children you move.
obs-rust is an AI-assisted fork of OBS; on Arch it's
obs-studio-rust-gitin the AUR.If you try it, a short reply here on whether your groups stay put would really help.
test: Skip my new core tests when libobs cannot start
libobs: Keep group children in place when the group resizes