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

Editor precise Scale and Rotate tools starts blinking when hovering over right toolbox #28865

Closed
OliBomby opened this issue Jul 14, 2024 · 1 comment · Fixed by ppy/osu-framework#6335
Assignees
Labels
area:editor osu!framework issue Can't resolve this without changes to osu!framework.

Comments

@OliBomby
Copy link
Contributor

Type

Game behaviour

Bug description

If you use 1.0x UI scaling, open the precise scale or rotate tool popover, scroll to the top of the right toolbox, and hover the right toolbox, the popover starts rapidly blinking back and forth every frame.

Screenshots or videos

Due to the framerate of the recording you can't see how it moves back and forth every frame.

osu._TVtrXlTHzG.mp4

Version

current master branch 14/07/2024

Logs

n/a

@frenzibyte
Copy link
Member

I thought this was gonna be a simple reordering of containers, but never mind...

@bdach bdach self-assigned this Jul 17, 2024
@bdach bdach added the osu!framework issue Can't resolve this without changes to osu!framework. label Jul 17, 2024
bdach added a commit to bdach/osu-framework that referenced this issue Jul 17, 2024
Closes ppy/osu#28865.

The issue is caused specifically by the "arrow" part of the popover.
The feedback loop involved in this is as follows:

- A popover is added to the scene graph. The automatic anchor selection
  logic chooses an anchor and a position for it. For the arrow part
  specifically, this is compounded with a counteracting adjustment
  that ensures that the popover arrow continues to point at its target
  drawable:

    https://github.com/ppy/osu-framework/blob/691d8671be5f65f76b4800e85141bb6fde67e139/osu.Framework/Graphics/Cursor/PopoverContainer.cs#L143-L147

- The base `Popover` class uses autosize on both axes of its
  `BoundingBoxContainer`, whose bounds are used to calculate the best
  anchor:

    https://github.com/ppy/osu-framework/blob/691d8671be5f65f76b4800e85141bb6fde67e139/osu.Framework/Graphics/UserInterface/Popover.cs#L21

  The arrow is under the bounding box container. Adjusting a drawable's
  position affects autosize by way of changing
  `RequiredParentSizeToFit`, which means that if the drawable's target
  is significantly off screen, the calculated autosize of the container
  rapidly balloons.

- If the popover size increases enough, then no anchors will be
  considered fitting (because to the automatic layouting logic, it looks
  like the popover won't fit in *any* direction). Thus, the popover's
  anchor is changed from whatever it was on the previous frame to
  `Centre`, and the arrow's position is reset to zero.

- The resetting of the arrow position to zero brings us back to
  the situation from the first point, completing the feedback cycle.

To counteract this, exclude the popover arrow from participating in
autosize calculations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:editor osu!framework issue Can't resolve this without changes to osu!framework.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants