AdamsLair / duality

a 2D Game Development Framework
https://adamslair.github.io/duality
MIT License
1.41k stars 288 forks source link

Tilemap scroll #687

Closed helle253 closed 6 years ago

helle253 commented 6 years ago

Related to #630 Added shift+click functionality: Allows the user to continue editing the selection rectangle in the tile palette after un-clicking. This lets the user modify the selection rectangle at will, without the need to constantly select an 'anchor point' if they want to add a row or column.

Added middle mouse scrolling: Pressing the middle mouse button now allows the user to dynamically pan around the tile palette window.

These two additional functionalities are atomic. One cannot occur while the other is occurring and vice versa. (this also applies to just left clicking and attempting to scroll)

helle253 commented 6 years ago

In addition to updating the shift + click to no longer need to move, also fixed a bug that prevented the user from 'clearing' the selection rectangle via a right click. It should be noted that the shift + click functionality ALWAYS uses the last 'left click' anchor point, even if no rectangle is present. e.g.

  1. select a rectangle normally
  2. right click to clear the selection rectangle
  3. shift + click on a different spot, note that a new selection anchor point is not generated, it uses the one generated on step 1.

I don't know if this qualifies as a bug or something where either behavior would be acceptable, but I would certainly be happy to hear input.

This has been fixed. I realized shift+click prior to ANY selection rectangle used (0,0) as the anchor, which I felt wasn't appropriate.

ilexp commented 6 years ago

Thanks for the PR! I'll leave this open for community review and will join in shortly.

helle253 commented 6 years ago

I did notice another minor bug w/ the selection rectangle in the tile palette. When resizing, if tiles within the selection are moved, the rectangle does not reset. It appears to use the first item in the next row as whatever it is pasting for the 'blank' rectangles.

This occurs in the master branch, so I don't think it's an issue introduced by me. I'll file an issue when I get a chance to record footage.

ilexp commented 6 years ago

@mfep Thanks for reviewing! Sounds like we'll be ready for merge.

I'll have a brief second look, hopefully soon, so we can wrap this up.

This occurs in the master branch, so I don't think it's an issue introduced by me. I'll file an issue when I get a chance to record footage.

👍

ilexp commented 6 years ago

Merged as per review by @mfep. Thanks everyone! 🙂