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

Rotation around selection center is not calculated correctly #29567

Open
cihe13375 opened this issue Aug 22, 2024 · 4 comments
Open

Rotation around selection center is not calculated correctly #29567

cihe13375 opened this issue Aug 22, 2024 · 4 comments

Comments

@cihe13375
Copy link

Type

Game behaviour

Bug description

  1. create a triangle centering at the playfield center
  2. select it and open the rotate panel
  3. input a non-zero number
  4. switch between "playfield center" and "selection center"
    note that the result positions are somewhat different, even though they should be the same. By checking against stable, it seems that the rotation around "playfield center" is correct but "selection center" is wrong.

Screenshots or videos

output.mp4

Version

master

Logs

@OliBomby
Copy link
Contributor

The selection center is currently calculated as the center of the quad surrounding the selection. Maybe a better definition of selection center could be the point that minimizes the maximum distance to all points in the selection.

@cihe13375
Copy link
Author

Maybe a better definition of selection center could be the point that minimizes the maximum distance to all points in the selection.

I did some simple experiments in stable and I think stable uses the centroid (average position of all circles), which is kinda intuitive for me. The point minimizing the maximum distance (center of smallest the enclosing circle) could also work and I can see why in some cases it's better, but I feel that this behavior can be quite surprising to new users. If this is the direction moving forward I think some visualization of the center position (and the enclosing circle) should be added.

Sliders are more complicated though. It seems that stable only uses sliderheads when calculating the selection center. I think this behavior is not bad (and sometimes better than considering the whole slider path), though I'm not against changing it either.

@OliBomby
Copy link
Contributor

OliBomby commented Aug 25, 2024

The centroid is an easy implementation, but I think the center of the smallest enclosing circle is better aligned with what we think of with 'selection center'. It can also properly take into account paths.

For example this pattern below is clearly centered on the (1) circle, but in stable it wouldn't rotate around the center. Also your example with the triangle would not work with centroid if one of the corners contained multiple stacked circles.
osu!_s7Vv2C3keD

Your suggestion to visualize the actual center of rotation seems useful. That would be nice to have.

@cihe13375
Copy link
Author

cihe13375 commented Aug 26, 2024

Can agree with the examples above. My concern is about the pattern below: I think it's quite surprising (and I also spent some time to realize it) that the center would be in the midpoint of 1 and 3, regardless of the position of 2 (as long as the angle 123 is >= 90 degrees)
with that saying, if the visualization is added then maybe users can understand it and make good use of it.
Screenshot_20240826_143224

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants