Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI: Add new preview grid #10604

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

GPattenden
Copy link
Contributor

Description

This PR adds a customizable square grid feature to improve source alignment within the preview.

The grid settings offer a range of options, including defining grid visibility, adjusting grid size using unit values, and optionally snapping sources to the grid for precise positioning. Grid visibility options include being always visible, never visible, or only visible when moving a source. Additionally, the existing snapping sensitivity setting can be used to fine-tune the grid snapping behavior, making it more or less tolerant to movement. Grid snapping can also be used in combination with the previously existing snapping features to make sources snap to grid lines, center lines and preview borders.

Grids are implemented using dotted lines featuring three distinct dot types: single pixels, 5-pixel crosses, and 9-pixel squares. The selection of dot types and the dot density between each grid line adapts dynamically based on the chosen preview size and grid spacing to preserve overall visibility.

This PR also introduces the possibility to personalize the grid color in the accessibility menu to better accommodate to users' preferences.

OBS.recording.mp4

Motivation and Context

These changes provide an implementation for a highly requested feature on the ideas page: https://ideas.obsproject.com/posts/329/grid-for-positioning

How Has This Been Tested?

Manual testing involved aligning various source types with the preview grid and exploring different combinations of grid visibility settings. The snapping behaviour was tested across various grid sizes and grid sensitivities, using varied sources and preview window dimensions. We also tested grid snapping by displacing sources in different directions and resizing them, confirming their alignment with the nearest grid line. Different colors were used for the grid throughout the testing process to ensure that the accessibility menu is working as expected. Finally, performance evaluations were conducted using multiple and various sources and grid spacings to ensure that the grid rendering does not affect the overall performance of the app.

Testing environment

Windows 11 23H2 (OS Build 22631.3447), 1920x1080 laptop screen

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

Adds a customizable square grid improving source alignment in the
preview. The grid settings offer flexibility, allowing users to control
grid visibility, adjust spacing using unit values, and snap sources to
enhance positioning. Finally, it adds the possibility to personalize
the grid color to better accommodate users' preferences.

Link to feature discussion:
https://ideas.obsproject.com/posts/329/grid-for-positioning

Co-authored-by: Afonso Domingues <[email protected]>
@gxalpha gxalpha requested a review from Warchamp7 April 26, 2024 06:19
@gxalpha gxalpha added New Feature New feature or plugin UI/UX Anything to do with changes or additions to UI/UX elements. labels Apr 26, 2024
@Warchamp7 Warchamp7 self-assigned this May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Feature New feature or plugin UI/UX Anything to do with changes or additions to UI/UX elements.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants