Skip to content

Conversation

@JunkyoLee
Copy link
Contributor

Previously, DragRect could not be resized if its current size was zero, which prevented users from initializing or adjusting the rectangle from a zero-size state.

Modified the logic to allow moving the rect only when either its width or height is non-zero

@brenocq brenocq requested a review from Copilot December 3, 2025 05:44
@brenocq brenocq added type:fix Something isn't working prio:high High priority status:review The task is under review labels Dec 3, 2025
@brenocq brenocq self-requested a review December 3, 2025 05:45
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a usability issue where DragRect widgets could not be resized when initialized with zero width and zero height. The fix conditionally disables the center-point move handle when the rectangle has zero size, while keeping all corner and edge resize handles accessible.

Key Changes:

  • Added is_movable check to disable center-point dragging when both dimensions are zero
  • Improved variable scoping by moving b_rect declaration inside conditional blocks
  • Maintained full resize functionality via corner and edge handles

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@brenocq brenocq added this to the v0.18 milestone Dec 3, 2025
Copy link
Collaborator

@brenocq brenocq left a comment

Choose a reason for hiding this comment

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

Lovely!!

master:

Kooha-2025-12-03-07-37-00.mp4

dragrect_resizing:

Kooha-2025-12-03-07-35-44.mp4

Thanks for the minimal changes and for following conventional commits :)

@brenocq brenocq changed the title fix: enable resizing of DragRect when its size is zero fix: DragRect resizing when its size is zero Dec 3, 2025
@brenocq brenocq changed the title fix: DragRect resizing when its size is zero fix: DragRect resizing when its size is zero Dec 3, 2025
@brenocq brenocq merged commit 81b8b19 into epezent:master Dec 3, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

prio:high High priority status:review The task is under review type:fix Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants