From 4e45ca651e205cc7ab3883af3c44b255f76696a9 Mon Sep 17 00:00:00 2001 From: RKrom Date: Mon, 8 Dec 2014 09:03:55 +0100 Subject: [PATCH] BUG-1716: As first UpdateTextBoxFormat was called, and than the font was disposed, we tried to draw something with a disposed font. [skip ci] --- Greenshot/Drawing/TextContainer.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Greenshot/Drawing/TextContainer.cs b/Greenshot/Drawing/TextContainer.cs index 965a9f28d..a42e7811e 100644 --- a/Greenshot/Drawing/TextContainer.cs +++ b/Greenshot/Drawing/TextContainer.cs @@ -173,15 +173,15 @@ namespace Greenshot.Drawing { void TextContainer_FieldChanged(object sender, FieldChangedEventArgs e) { if (_textBox.Visible) { - UpdateTextBoxFormat(); _textBox.Invalidate(); - } else { - UpdateFormat(); - //Invalidate(); } _font.Dispose(); _font = null; fontInvalidated = true; + UpdateTextBoxFormat(); + if (_textBox.Visible) { + _textBox.Invalidate(); + } } public override void OnDoubleClick() {