Add rounded rectangle support#5405
Conversation
aseprite-bot
left a comment
There was a problem hiding this comment.
clang-tidy made some suggestions
71eb871 to
fafae9f
Compare
aseprite-bot
left a comment
There was a problem hiding this comment.
clang-tidy made some suggestions
1e882dd to
ba65940
Compare
aseprite-bot
left a comment
There was a problem hiding this comment.
clang-tidy made some suggestions
ba65940 to
b55084e
Compare
|
Great! At first glance it works very well.
Comments:
|
|
@Gasparoken thanks for the feedback!
Sure, no problem.
👍
I'm not sure if I'm getting this right. The radius doesn't have a hard limit, basically it is visually limited by the size of the rectangle, but the radius can be bigger than the visible radius. If you set a big corner radius it will be adjusted according to rectangle size. So, are you proposing that the radius should not be increased once the max visible radius for the current rectangle size is reached? In which case, once the user reached the max visible radius they would be forced to resize the rectangle first and then increment the radius, right? |
IMO, this is not convenient because you lose the visual feedback of the radius.
Yes, that's right.
No, IMO the correct behavior is:
I think it's best for the artist to modify one parameter at a time, rather than enabling a double modification (radius + rectangle size ). I can imagine your approach, but I found one case that might be annoying for the artist: Anyway, maybe I misinterpreted your proposal, or you've come up with something better. Let me know if that's the case. |
aseprite-bot
left a comment
There was a problem hiding this comment.
clang-tidy made some suggestions
c2642f1 to
777a339
Compare
Before this change the corner radius displayed in the status bar was just the latest corner radius set
Without this change the marquee tool and rectangle tool shared the latest corner radius set. Now each one can have its own setting
4d3f89a to
908aca2
Compare
|
Something has changed...now the slider doesn't show up anymore...I will be fixing that along the other things. EDIT: Alright, maybe nothing changed...it turns out that in single window UI mode it works, but with multiple windows it doesn't...not sure if it worked before the rebase. |
aseprite-bot
left a comment
There was a problem hiding this comment.
clang-tidy made some suggestions
| const bool isFloodfill = tool && (tool->getPointShape(0)->isFloodFill() || | ||
| tool->getPointShape(1)->isFloodFill()); | ||
|
|
||
| const bool hasCornerRadius = tool && !isText && |
There was a problem hiding this comment.
warning: implicit conversion 'tools::Tool *' -> 'bool' [readability-implicit-bool-conversion]
| const bool hasCornerRadius = tool && !isText && | |
| ( != nullptr) |
|
@dacap Last commit adds the item 4 you mentioned in your last review, but it doesn't work on macOS (using multiple windows). However, it does work on Windows (I didn't test it on Linux yet). The issue on macOS occurs because when the user starts dragging something the mouseMove events received are coming from the window that received the mouseDown. Then the position of the mouse is relative to that native window, and not to the popup window that has the widget to which I'm trying to offer the capture, hence the windows manager is not able to pick the slider. It seems that this is due to the fact that in macOS there is no captureMouse() and releaseMouse() implementations. So I'll see if I can do something about this to fix it. |
|
I couldn't find any fix today. I think it would be better to leave it as is and file a new issue for macOS later. Thus we don't delay the rounded rectangle support anymore. I've tried:
|
|
I've tested on Linux and it works great! I'll merge it as it is, we can take a look to the macOS issue later. I'm not sure if the UI will be kept in this way, or a text field that is expanded in the same context bar might be a better option in the future (so the corner radius button acts like a checkbox to make show/hide the text field in the same context bar). |
Fix #2184
Introduces a couple of algorithms to draw the rounded corners:
How to use it:
Draw a regular rectangle and use the C key as the corner radius modifier. Move the mouse inside/outside the corner to change the radius. This also works for the rectangular marquee tool.
TODO: