mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-23 22:43:32 +00:00
Fix error using an invalid crop_image() with Width < 1, Height < 1 when using New Brush with right-click outside the canvas bounds
This commit is contained in:
parent
8281e49798
commit
8405add137
@ -113,9 +113,12 @@ void NewBrushCommand::onQuickboxEnd(Editor* editor, const gfx::Rect& rect, ui::M
|
||||
try {
|
||||
ContextWriter writer(UIContext::instance(), 250);
|
||||
if (writer.cel()) {
|
||||
Tx tx(writer.context(), "Clear");
|
||||
tx(new cmd::ClearRect(writer.cel(), rect));
|
||||
tx.commit();
|
||||
gfx::Rect canvasRect = (rect & writer.cel()->bounds());
|
||||
if (!canvasRect.isEmpty()) {
|
||||
Tx tx(writer.context(), "Clear");
|
||||
tx(new cmd::ClearRect(writer.cel(), canvasRect));
|
||||
tx.commit();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (const std::exception& ex) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user