public void ResizeCanvas(int width, int height, Anchor anchor, CompoundHistoryItem compoundAction)
{
double scale;
if (ImageSize.Width == width && ImageSize.Height == height)
return;
PintaCore.Tools.Commit ();
ResizeHistoryItem hist = new ResizeHistoryItem (ImageSize);
hist.Icon = "Menu.Image.CanvasSize.png";
hist.Text = Catalog.GetString ("Resize Canvas");
hist.StartSnapshotOfImage ();
scale = Workspace.Scale;
ImageSize = new Gdk.Size (width, height);
foreach (var layer in UserLayers)
layer.ResizeCanvas (width, height, anchor);
hist.FinishSnapshotOfImage ();
if (compoundAction != null) {
compoundAction.Push (hist);
} else {
Workspace.History.PushNewItem (hist);
}
ResetSelectionPaths ();
Workspace.Scale = scale;
}