Skip to content

UI: Preserve position during alignment change#4734

Closed
Oekn5w wants to merge 1 commit intoobsproject:masterfrom
Oekn5w:feat-trafo-alignment
Closed

UI: Preserve position during alignment change#4734
Oekn5w wants to merge 1 commit intoobsproject:masterfrom
Oekn5w:feat-trafo-alignment

Conversation

@Oekn5w
Copy link

@Oekn5w Oekn5w commented May 20, 2021

Description

Changing the alignment of a scene item in the edit transformation dialog now no longer moves the position of the item in the scene.

Motivation and Context

Better usability of the edit transformation dialog. No issue or idea has been raised as far as known.

How Has This Been Tested?

This was tested by visually checking for movement of the scene item when changing
Developed and tested on 64-bit Ubuntu 20.04 (VM).

Types of changes

  • Performance enhancement (non-breaking change which improves efficiency) (UX)

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.

@WizardCM WizardCM added the Enhancement Improvement to existing functionality label May 20, 2021
@dodgepong
Copy link
Member

Can you explain why it's bad that the transform window live-updates the scene item transform? My impression is that live updating is preferred behavior. I have never heard someone complain about this behavior, and would challenge the notion that this PR improves usability.

@dodgepong
Copy link
Member

Nevermind, I misread the description and didn't realize that this only applied specifically to Positional Alignment property. I'm unsure what the proper behavior should be here, though. I feel like the position shouldn't change, but also the setting itself might need to be renamed to something more descriptive, such as "Transform anchor point" or something. Just spitballing.

My mind is immediately drawn to the grid-style controls in something like Photoshop:

image

@Oekn5w Oekn5w force-pushed the feat-trafo-alignment branch from d04483d to 4476e82 Compare May 21, 2021 07:49
@Oekn5w
Copy link
Author

Oekn5w commented May 21, 2021

@dodgepong Good points about the visual redesign of the drop down and the rename. I wanted to add a bit of information anyway to that dialog afterwards (Original size, scaling). If you don't mind, I'd include your proposed changes with that PR then, independent of this one.

@dodgepong
Copy link
Member

I think it's fine for a separate PR -- my comment was more a response to the source of my own confusion on what this PR did.

@Oekn5w
Copy link
Author

Oekn5w commented Jun 7, 2021

Blocked for now, I didn't take rotation and scaling into account.

@WizardCM WizardCM marked this pull request as draft June 7, 2021 05:58
@Oekn5w Oekn5w force-pushed the feat-trafo-alignment branch from 4476e82 to 8dbf8fd Compare June 12, 2021 17:05
@Oekn5w Oekn5w marked this pull request as ready for review June 12, 2021 17:06
@Oekn5w Oekn5w force-pushed the feat-trafo-alignment branch from 8dbf8fd to eb1544a Compare June 12, 2021 17:25
@Oekn5w
Copy link
Author

Oekn5w commented Jun 12, 2021

Fixed missing rotation and scaling, rebased onto master

@dodgepong dodgepong added the Seeking Testers Build artifacts on CI label Jun 16, 2021
@norihiro
Copy link
Contributor

norihiro commented Jul 18, 2021

I tried this PR and noticed an issue.

Condition:

  • Bounding Box Size has different aspect than that of the source size.
  • Bounding Box Type is Scale to inner bounds, Scale to outer bounds, Scale to width of bounds, Scale to height of bounds, or Maximum size only.
  • Alignment in Bounding Box is Center (some other options also show the same issue.)

Expected behavior:
The position of the source does not move.

Actual behavior:
The position of the source moves again and again when changing Positional Alignment.

@Oekn5w Oekn5w marked this pull request as draft August 27, 2021 09:55
@WizardCM
Copy link
Member

Hi there @Oekn5w - just wanted to check in to see if you plan on solving the mentioned issue above. No rush, just wanted to know.

@Oekn5w
Copy link
Author

Oekn5w commented Dec 12, 2021

@WizardCM ty for checking back, I'm looking into utilizing the existing transform function, but didn't find the time yet to implement this fully. (And tbh, I had forgotten about this PR.)

@WizardCM
Copy link
Member

No problem, thanks for providing an update.

@Oekn5w Oekn5w force-pushed the feat-trafo-alignment branch 2 times, most recently from 4b27a6c to cb1e4f3 Compare December 19, 2021 22:28
@Oekn5w Oekn5w marked this pull request as ready for review December 19, 2021 22:36
@Oekn5w
Copy link
Author

Oekn5w commented Dec 19, 2021

@WizardCM updated
@norihiro can you re-check this?

Changes: Update to use the existing transform function and its matrices when getting the position difference.

@Oekn5w Oekn5w force-pushed the feat-trafo-alignment branch from cb1e4f3 to 9659f00 Compare December 20, 2021 12:45
@norihiro
Copy link
Contributor

The issue I reported at #4734 (comment) looks solved.

@Oekn5w Oekn5w force-pushed the feat-trafo-alignment branch from 9659f00 to 9425937 Compare August 6, 2022 10:42
ui->cropTop->setValue(int(crop.top));
ui->cropBottom->setValue(int(crop.bottom));

oti_save = osi;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use a more informative variable name here and use camelCase instead (we tend to prefer camelCase for C++ and ObjC and snake_case for pure C).

// ->
// M_pos_12 = (T_2*)^(-1) * T_1

struct matrix4 mat_T1, mat_T2_star, mat_t12;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not use comma-based declaration, you can also write out matrix in the variable names (using matrix_T1 itself is ok because it follows the formulas in the comment above).

I also think it should be ok to disable clang-format for that comment block to make the formulas more readable.

@PatTheMav
Copy link
Member

@Warchamp7 Would like to hear your take on this regarding UX - if I change the alignment anchor, I currently don't know if I'd expect the position coordinates to be adapted to the changed alignment or instead be kept as is and thus the source position changes implicitly.

@Warchamp7
Copy link
Member

@Warchamp7 Would like to hear your take on this regarding UX - if I change the alignment anchor, I currently don't know if I'd expect the position coordinates to be adapted to the changed alignment or instead be kept as is and thus the source position changes implicitly.

I approve of the behaviour conceptually where the source does not move when changing the anchor point.

@Oekn5w
Copy link
Author

Oekn5w commented Jan 15, 2024

@PatTheMav Thanks for the review, I'll try and rebase the change to the current master but I'll have to fix my local dev environment first.

@PatTheMav
Copy link
Member

@Warchamp7 Is this PR possibly superseded by your recent transform window PR?

@Warchamp7
Copy link
Member

@Warchamp7 Is this PR possibly superseded by your recent transform window PR?

Yes

@PatTheMav
Copy link
Member

@Warchamp7 Is this PR possibly superseded by your recent transform window PR?

Yes

Feel free to close it with an appropriate comment then.

@Oekn5w
Copy link
Author

Oekn5w commented Sep 26, 2025

Never got around to trying to implement the Photoshop's UI in QT, and this is now vastly out of date.
Thanks for taking the concept.
Superseded by #12410

@Oekn5w Oekn5w closed this Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Improvement to existing functionality Seeking Testers Build artifacts on CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants