-
-
Notifications
You must be signed in to change notification settings - Fork 397
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
New selection system #474
Merged
Merged
New selection system #474
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ular shape and multiple SelectionShapes can exist - Create multiple selection rectangles - Merge them together if they intersect - Move the selections (without contents as of right now) - Gizmos are being drawn but they are not functional yet Code is very ugly.
I did this, no idea if it works properly, probably won't be used but I thought I'd keep it saved somewhere
Trying to generate a polygon from the individual selected pixels
Code is still a mess, don't bother looking.
The purpose of this is to generalize some selection code, so that it applies to all polygons, the entire selection. More will follow.
Nothing else in the selections system works properly in UndoRedo right now. Needs: - UR support for creating selections - UR support for modifying selections (merging and cutting selections together) - UR support for removing selection - UR support for moving content & for all the rest of the remaining features
Handle all of the polygons there instead of having them as individual nodes. Should be easier to handle undo/redo this way. This commit probably breaks move tool + selection tool and undo/redo. Code is still a mess. For your sanity, I hope you are not reading this. I promise I will clean up.
Buggy and messy, of course.
… instead of each polygon having its own image Could be further optimized for some specific cases. We could also remove selected_pixels from SelectionPolygon.
UndoRedo support for moving content not added in this commit. Should work but needs more testing. This PR also removes selected_pixels from the SelectionPolygon class.
… too Press Enter or do any editing to confirm movement, Escape to cancel. I will most likely add UI buttons for confirm and cancel too.
Pasting now no longer requires a pre-existing selection and instead copies the selections themselves too.
…s options Clear Selection now also confirms content moving. TopMenuContainer code has changed to no longer rely on Global for the menu buttons.
No functionality yet. They may need to be turned to nodes, so that they can easily resize based on zoom level and check for mouse enter/exit events.
…ctangle instead of individual selection parts Still no functionality yet.
This will execute the for loop less times
…e click Now I should actually make them resize when dragged, aye?
This should optimize the selection making a lot, and it also allows for easy border drawing without having to deal with polygons, thanks to the MarchingAntsOutline.shader Still commit is still a WIP, image effects and brushes may not work properly yet. Because the BitMap has a fixed size, the size of the project, moving the selection outside of canvas boundaries has proven to be a bit tricky. I did implement a hacky way of handling it, but it may be buggy and problematic. I'm still unsure whether this is the best way to handle the situation.
After they release the mouse, the black rectangle becomes the selection
…ow gets limited to the canvas bounds Resizing currently does not work properly with negative (left & up) canvas boundaries
…as boundaries (not working properly yet)
And fix preview_image vertical flipping
Rotation algorithms now accept and only work with a given image, and the pivot has been added as a parameter
Transforming the selection outside of the canvas is still broken.
And make sure the frequency of the marching ants effect always looks roughly the same on all project sizes
…or control are currently pressed
Although this behavior might not be the intended one
Useful for when the selection is in negative coords
This fixes the issue of project switching and keeping the previous project's offset. Again, this is only relevant for when the selection is in negative coords.
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses parts of #129. This PR does not include any new selection tools yet, only a new move tool.
The selection system behavior you see in this PR is not final. The UX is still a work in progress and development will most likely continue in the master branch from now on.
Finally. I've been working on this branch for at least two months. It's not ready yet, but it should be stable enough to be merged to the master branch. This PR is targeted for v0.9 and not v0.8.x.
What's new in this PR:
Rotation code is also included, but it is not working properly yet.
2021-04-17.03-19-21.mp4
2021-04-17.03-21-14.mp4