From f6be666aab1c0e0b80cffd887303987c4ce97fb5 Mon Sep 17 00:00:00 2001 From: RKrom Date: Fri, 19 Oct 2012 11:50:45 +0000 Subject: [PATCH] Fixed bug #3578325, editor size doesn't to capture. git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2160 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4 --- Greenshot/Forms/ImageEditorForm.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Greenshot/Forms/ImageEditorForm.cs b/Greenshot/Forms/ImageEditorForm.cs index d4484997b..2957650c6 100644 --- a/Greenshot/Forms/ImageEditorForm.cs +++ b/Greenshot/Forms/ImageEditorForm.cs @@ -93,16 +93,16 @@ namespace Greenshot { IniConfig.IniChanged += new FileSystemEventHandler(ReloadConfiguration); + // Make sure the editor is placed on the same location as the last editor was on close + WindowDetails thisForm = new WindowDetails(this.Handle); + thisForm.SetWindowPlacement(editorConfiguration.GetEditorPlacement()); // init surface Surface = iSurface; // Intial "saved" flag for asking if the image needs to be save surface.Modified = !outputMade; - updateUI(); - // Make sure the editor is placed on the same location as the last editor was on close - WindowDetails thisForm = new WindowDetails(this.Handle); - thisForm.SetWindowPlacement(editorConfiguration.GetEditorPlacement()); + updateUI(); // Workaround: As the cursor is (mostly) selected on the surface a funny artifact is visible, this fixes it. hideToolstripItems(); @@ -791,6 +791,9 @@ namespace Greenshot { #region helpers private void updateUndoRedoSurfaceDependencies() { + if (surface == null) { + return; + } bool canUndo = surface.CanUndo; this.btnUndo.Enabled = canUndo; this.undoToolStripMenuItem.Enabled = canUndo; @@ -820,6 +823,9 @@ namespace Greenshot { } private void updateClipboardSurfaceDependencies() { + if (surface == null) { + return; + } // check dependencies for the Surface bool hasItems = surface.HasSelectedElements(); bool actionAllowedForSelection = hasItems && !controlsDisabledDueToConfirmable;