mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 06:32:42 +00:00
Fix crash creating a new brush from an empty cel using right-click
This commit is contained in:
parent
6a1a9556ae
commit
2d632339e0
@ -115,9 +115,11 @@ void NewBrushCommand::onQuickboxEnd(Editor* editor, const gfx::Rect& rect, ui::M
|
||||
if (buttons & ui::kButtonRight) {
|
||||
try {
|
||||
ContextWriter writer(UIContext::instance(), 250);
|
||||
Transaction transaction(writer.context(), "Clear");
|
||||
transaction.execute(new cmd::ClearRect(writer.cel(), rect));
|
||||
transaction.commit();
|
||||
if (writer.cel()) {
|
||||
Transaction transaction(writer.context(), "Clear");
|
||||
transaction.execute(new cmd::ClearRect(writer.cel(), rect));
|
||||
transaction.commit();
|
||||
}
|
||||
}
|
||||
catch (const std::exception& ex) {
|
||||
Console::showException(ex);
|
||||
|
Loading…
x
Reference in New Issue
Block a user