Skip to content

Requests: Fix SetSceneItemTransform bounds check - #1367

Open
fcolona wants to merge 1 commit into
obsproject:masterfrom
fcolona:fix-bounds-validation
Open

fcolona wants to merge 1 commit into
obsproject:masterfrom
fcolona:fix-bounds-validation

Conversation

@fcolona

@fcolona fcolona commented Nov 11, 2026

Copy link
Copy Markdown

Description

In SetSceneItemTransform, I modified the value passed to the minValue parameter of ValidateOptionalNumber in the calls related to boundsWidth and boundsHeight. The minimum value is initialized with the same value as before, 1.0, but now there's a check that decreases the value to 0.0 if either the existing boundsType or the newly set is equal to OBS_BOUNDS_NONE.

Motivation and Context

Currently, GetSceneItemTransform returns boundsWidth: 0 and boundsHeight: 0 when boundsType is set to OBS_BOUNDS_NONE. However, the validator in SetSceneItemTransform for the bounds dimensions hardcodes a minimum value of 1.0 for these fields. Because of this, feeding the exact output of the Get request back into the Set request unexpectedly fails with error 402. Fixes obsproject/obs-studio#13124.

How Has This Been Tested?

I manually tested four SetSceneItemTransform request scenarios, each scenario combined with partial and complete updates:

  • Request with boundsType different from OBS_BOUNDS_NONE and bounds dimensions greater than 0 (valid)
  • Request with boundsType different from OBS_BOUNDS_NONE and bounds dimensions equal to zero (invalid)
  • Request with boundsType equal to OBS_BOUNDS_NONE and bounds dimensions greater than zero (valid)
  • Request with boundsType equal to OBS_BOUNDS_NONE and bounds dimensions equal to zero (now valid)

Tested OS(s): Arch Linux (Wayland, Kernel 7.1.5-arch1-2)

Types of changes

Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have read the Contributing Guidelines.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • My code is not on master or a release/* branch.
  • The code has been tested.
  • I have included updates to all appropriate documentation.

SetSceneItemTransform validation didn't allow a scene item's bounds to
be equal to zero, not even when the bounds type was equal to
OBS_BOUNDS_NONE. This wouldn't allow the valid response of
GetSceneItemTransform, when it contained an item whose bounds have not
been modified, to be directly sent to SetSceneItemTransform without
returning an error.
@fcolona
fcolona force-pushed the fix-bounds-validation branch from 17a34c0 to a29f637 Compare November 11, 2026 20:27

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Websocket returns invalid bounds with GetSceneItemTransform

1 participant