-
-
Notifications
You must be signed in to change notification settings - Fork 398
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
Add Rectangle and Ellipse tools #456
Add Rectangle and Ellipse tools #456
Conversation
f3a2a06
to
8bf57d1
Compare
Ok so i checked and it works great but i noticed two things: |
b4037e1
to
8bf57d1
Compare
I have addressed these two points in the latest commits. |
OK, so i checked and it appears to work fine but an idea hit me, |
I don't know if I understood correctly what you were asking for, but check out the commit I've just pushed. Press CTRL before releasing the mouse button to keep the preview on screen. Then, press again to confirm the preview. If you hold CTRL and press the mouse button instead, you will draw another preview, though it will not stay on screen if you release CTRL. |
you under stood correctly. now the only thing left is to make the preview rectangles (or preview ellipse) follow the mouse till a mouse click (left for left tool and right for right tool) is pressed that would allow us to place the shape more accurately on the canvas Exactly like what it does with the pencil tool here (except that for the shapes tool we can draw the shapes ourselves instead of just using a simple circle) pixelorama-2021-02-19_14.38.17.mp4 |
Ok, the shapes should follow the mouse now. |
Yep, works like a charm |
Extremely useful addition. I have some suggestions to make before it gets merged.
Consider changing those elements and the PR is good to go! |
About point 1, could you attach a video or image showing this problem? For me, it seems to be working correctly, the preview matches the drawn shape, and the way the shape scales while holding shift and moving the mouse seems to be very similar to what you see in other pixel art software, like Piskel. |
How about this, we could remove the control. Instead we could set it in such a way that a single click will move the preview where the mouse is currently at and double-click will draw the shape (or an "Apply" button can simply be placed in the tool settings instead of double-click) |
I can replicate the issue on Windows 10. 2021-02-23.21-31-42.mp4In the video I am always holding the Shift button, and the end result is correct, but the preview is flickering. |
As for the other points, I'd say to remove the Control functionality completely (and use Control for the behavior that is used in Alt) for now and discuss it again in the future once the new selection system has been finalized, in case we can use it to move the shape after it has been created. So, Shift for keeping aspect ratio, Control for expanding from center. I also think putting the 2 shapes as 2 different tools would be better, it would allow easier switching for the users as they can map them to different keyboard shortcuts. New tools will be added in v0.9 so the pollution problem will most likely occur anyway, but that's a different issue. We could group tools together in a single icon, like GIMP and Aseprite does it, if it becomes a problem. |
Alright, I think I've addressed most of these issues. I've made various changes so more testing is needed.
This is supposed to be fixed now
The previous implementation of the ctrl button has been removed. Now, ctrl is used to draw 1:1 shapes.
Added those as well
Made them separate |
Should I change the expand from click origin button to be CTRL instead of ALT and make the draw 1:1 shape button be SHIFT, or the current configuration (CTRL = Draw 1:1 / ALT = Expand from click origin) is ok? |
You should change the alt button to ctrl.
…On Sat, Mar 6, 2021, 5:45 AM DragonOfWar ***@***.***> wrote:
Should I change the expand from click origin button to be CTRL instead of
ALT and make the draw 1:1 shape button be SHIFT, or the current
configuration (CTRL = Draw 1:1 / ALT = Expand from click origin) is ok?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#456 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASRLYGXLZRFVCZUHZHL43ILTCF3KXANCNFSM4XVCZNIQ>
.
|
Yeah I think Ctrl for expand from center and Shift for 1:1 might be better. In the future we'll make these shortcuts customizable for the users anyway, so everyone can have their own configuration. (#309) |
Done. If I haven't missed anything, it should be good to go. |
Looking nice, I too think it's good to go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you!
Closes #359
This PR adds a tool that allows you to draw shapes, like rectangles and ellipses. It also allows you to draw shapes with a 1:1 aspect ratio (so you can draw circles and squares), by holding down the shift key.
TODO:
Cleaning upAdd the ability to move the shape's center to the click origin by pressing CTRLAdd blue theme buttonsFix preview not working when drawing with the right mouse buttonRework brush sizeAdd config functionsFix some pixels not being filled when drawing a tall 4 pixels wide ellipseThere's a bug where sometimes drawing a shape will spam the output with errors, but I haven't found a way to consistently reproduce it.I think this was fixedI'll add images and gifs of the tool in action later today.
Edit 1: Added the ability to move the shape's center to the click origin, but with ALT instead of CTRL. I can change it if CTRL is preferable. Maybe we should add these commands to the keybindings?
I also added a checkbox that allows you to draw filled shapes. A better algorithm for drawing the filled ellipse might be needed.
Edit 2: I'm going to make this PR ready for review now. Here's a video showing off the tool in action:
Screencast.2021-02-16.15.09.25.mp4