Currently, the spacing lines begin in the middle of the box and then are
their width wide towards one direction. This means that the larger they
are, the more off-center their middle is.
This commit changes them to start at half their width left/top of the
center and end half the width to the right/bottom of the center, putting
the middle in the center.
Group resize is not deferred until adjustments are completed by a
mouseReleaseEvent in certain cases, resulting in unexpected movement of
sources that are part of a group as they are resized or stretched
beyond group bounds.
The bug can be described/reproduced as follow:
1. The user selects within a group in the sources dock
2. The user moves their mouse over the selected source such that the
cursor would change.
- This results in a cursor update and a call to GetStrechHandle()
- as the source is part of a group, stretchGroup will be set to the
group of the source
3. The user clicks on the canvas without touching a stretch/rotation
handle
- A mouseReleaseEvent is fired
- obs_sceneitem_defer_group_resize_end is called on the group as
stretchGroup is still defined from earlier
- the defer_group_resize member of the group will become negative
- The deferal check in resize_group (obs-scene.c) will always pass
now
4. When scaling or rotating the source close to the group bounds, the
group bounds will now dynamically update causing the source in to fly
off the canvas.
Resolves: https://github.com/obsproject/obs-studio/issues/9754
The use of GetCurrentSceneItem can lead to a race condition between
the graphics thread (where this function will be run) and the main UI
thread, as both access the scene list model and iterate through its
members which can change during iteration (as there is no lock around
its access).
Same as previous commits, flipped sceneitems in bounding boxes ought
to be treated as not flipped for the purpose of UI interaction in
order to function correctly.
Flip state of the item should be ignored when drawing guides for items
in bounding boxes, as the UI uses the countour of the bounding box, not
of the flipped item in it.
The preview interaction and decoration of items inside bounding boxes
is based on the bounding box state, not on the item's state. As such,
the flip state of the item should be ignored when drawing and finding
the rotation handle, since the bounding box itself isn't flipped, only
the item inside the bounding box.
The angle at which the rotation handle is drawn is independant from the
sceneitem's flip. As such, this changes `FindHandleAtPos` to use the rotation
angle of the item, free of its flip, instead of doing post-rotation
corrections. This fixes a bug where when the item was horizontally flipped,
the handle was not "found" at its drawn location.
Fix a bug where if a source's width or height becomes 0 while you're
stretching the size of a source or modifying it from the transform
dialog, it would become permanently invisible
Closesobsproject/obs-studio#7962
If the scene item was rotated greater than 45 degrees, and flipped
vertically or horizontally, the spacing helpers would be drawn
incorrectly. This fixes the issue by checking the scale before
the rotation, instead of after.
Selection state can change by main thread while UI thread (which
calls DrawSpacingHelpers) tries to evaluate the amount of selected
items. Get amount of selected items by enumerating over the scene data
instead (which stays within the graphics thread).
Calling `devicePixelRatioF` from any thread but the main UI thread
triggers thread-safety warnings at runtime on macOS, because Qt uses
NSView calls to determine the value.
NSView calls are only allowed to be made from the main thread on macOS,
so instead the value is stored as a property of the OBSQTDisplay at
initialization, to be retrieved from the preview object later.
Static functions that do not have access to the preview object have the
pixel ratio passed in their call signature.
This shows distance between sides of preview and edges of sources.
This will allow users to more easily align sources.
Co-authored-by: Palakis <contact@slepin.fr>
This change introduces an accessibility menu to settings, along with
options for overriding the colors used by OBS in the mixer and in the
preview to be more color blind friendly than the options provided by the
current theme.
Among the systems we officially support, the oldest Qt version is Qt 5.9
on Ubuntu 18.04. Fractional scaling is supported in Qt 5.6 and newer. We
should be able to safely remove these ifdefs.
The undo/redo functions are setting the current scene. Everytime
it would do this, it would actually transition to the scene.
This forces the current scene, so it fixes a bug where the
transition would be grayed out when undoing/redoing.