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

bitECS: Fix rotation with Object menu #6242

Merged
merged 1 commit into from
Sep 1, 2023
Merged

bitECS: Fix rotation with Object menu #6242

merged 1 commit into from
Sep 1, 2023

Conversation

takahirox
Copy link
Contributor

Fixes #6241

This PR fixes roation operation with the Object menu.

Problem

Rotation focus is not released even if releasing mouse click if you release the space bar earlier than mouse click release.

The root issue is heldExitQuery for handling mouse click release is not called if ObjectMenu.targetRef[menu] is not set.

Then if ObjectMenu.targetRef[menu] is cleared by releasing the space bar earlier than releasing mouse click, heldExitQuery won't be called.

Solution

Always call heldExitQuery.

Changes

  • Always call heldExitQuery
  • Save rotation/scale taget entity id when the operaton starts because rotation/scale are operated by dragging so that the operations can continue even if the cursor hovers off the target entity
  • Use the saved target entity id when the operation ends

This PR fixes roation operation with the Object menu.

**Problem**

Rotation focus is not released even if releasing mouse click
if you release the space bar earlier than mouse click release.

The root issue is heldExitQuery for handling mouse click release
is not called if ObjectMenu.targetRef[menu] is not set.

Then if ObjectMenu.targetRef[menu] is cleared by releasing the
space bar earlier than releasing mouse click, heldExitQuery
won't be called.

**Solution**

Always call heldExitQuery.

**Changes**

- Always call heldExitQuery
- Save rotation/scale taget entity id when the operaton starts
  because rotation/scale are operated by dragging so that
  the operations can continue even if the cursor hovers off
  the target entity
- Use the saved target entity id when the operation ends
@takahirox takahirox merged commit a783fd6 into master Sep 1, 2023
9 of 11 checks passed
@takahirox takahirox deleted the FixRotation branch September 1, 2023 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-loader P1 Address as quickly as possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bitECS: Rotation focus is not released
2 participants