mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-16 05:42:32 +00:00
[lua] Fix Sprite:resize() to resize non-active sprite
This commit is contained in:
parent
b0a8b50246
commit
cbd3ee2cd7
@ -155,7 +155,10 @@ int Sprite_resize(lua_State* L)
|
|||||||
params.set("height", base::convert_to<std::string>(size.h).c_str());
|
params.set("height", base::convert_to<std::string>(size.h).c_str());
|
||||||
|
|
||||||
app::Context* appCtx = App::instance()->context();
|
app::Context* appCtx = App::instance()->context();
|
||||||
|
auto oldDoc = appCtx->activeDocument();
|
||||||
|
appCtx->setActiveDocument(static_cast<Doc*>(sprite->document()));
|
||||||
appCtx->executeCommand(resizeCommand, params);
|
appCtx->executeCommand(resizeCommand, params);
|
||||||
|
appCtx->setActiveDocument(oldDoc);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user