mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 02:37:03 -07:00
This fixes a bug where the AutoCrop can't be undone, there is still a bug where a redo of a crop (auto or normal) doesn't update the bindings.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2310 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
5c594a27b5
commit
3d62f9c279
1 changed files with 13 additions and 9 deletions
|
@ -734,15 +734,19 @@ namespace Greenshot.Drawing {
|
|||
public bool AutoCrop() {
|
||||
Rectangle cropRectangle = ImageHelper.FindAutoCropRectangle(Image, conf.AutoCropDifference);
|
||||
if (isCropPossible(ref cropRectangle)) {
|
||||
DrawingMode = DrawingModes.Crop;
|
||||
cropContainer = new CropContainer(this);
|
||||
cropContainer.Left = cropRectangle.X;
|
||||
cropContainer.Top = cropRectangle.Y;
|
||||
cropContainer.Width = cropRectangle.Width;
|
||||
cropContainer.Height = cropRectangle.Height;
|
||||
DeselectAllElements();
|
||||
AddElement(cropContainer);
|
||||
SelectElement(cropContainer);
|
||||
// Maybe a bit obscure, but the following line creates a drop container
|
||||
// It's available as "undrawnElement"
|
||||
DrawingMode = DrawingModes.Crop;
|
||||
undrawnElement.Left = cropRectangle.X;
|
||||
undrawnElement.Top = cropRectangle.Y;
|
||||
undrawnElement.Width = cropRectangle.Width;
|
||||
undrawnElement.Height = cropRectangle.Height;
|
||||
undrawnElement.Status = EditStatus.UNDRAWN;
|
||||
AddElement(undrawnElement);
|
||||
SelectElement(undrawnElement);
|
||||
drawingElement = null;
|
||||
undrawnElement = null;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -970,7 +974,7 @@ namespace Greenshot.Drawing {
|
|||
if (drawingElement == null && DrawingMode != DrawingModes.None) {
|
||||
if (undrawnElement == null) {
|
||||
DeselectAllElements();
|
||||
if(undrawnElement == null) {
|
||||
if (undrawnElement == null) {
|
||||
CreateUndrawnElement();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue