Fix incorrect cropping rectangle calculation in canvas size command in lua script

Prior to this fix, CanvasSize command via lua script results in bad canvas and image clipping.
This commit is contained in:
Gaspar Capello 2021-09-22 14:38:14 -03:00 committed by David Capello
parent f687ddef72
commit 83c18399a4

View File

@ -364,9 +364,14 @@ void CanvasSizeCommand::onExecute(Context* context)
Preferences::instance().canvasSize.trimOutside(params.trimOutside());
bounds.enlarge(
gfx::Border(params.left(), params.top(),
params.right(), params.bottom()));
if (params.bounds.isSet()) {
bounds = params.bounds();
}
else {
bounds.enlarge(
gfx::Border(params.left(), params.top(),
params.right(), params.bottom()));
}
}
#endif