mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 02:37:03 -07:00
BUG-2013 : This might fix the NRE as the events might not be in line with the cleaning up...
This commit is contained in:
parent
157d3cc4ba
commit
d40461ec47
1 changed files with 11 additions and 3 deletions
|
@ -205,6 +205,10 @@ namespace Greenshot.Drawing
|
|||
|
||||
void TextContainer_FieldChanged(object sender, FieldChangedEventArgs e)
|
||||
{
|
||||
if (_textBox == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (_textBox.Visible)
|
||||
{
|
||||
_textBox.Invalidate();
|
||||
|
@ -225,7 +229,7 @@ namespace Greenshot.Drawing
|
|||
}
|
||||
UpdateTextBoxFormat();
|
||||
|
||||
if (_textBox != null && _textBox.Visible)
|
||||
if (_textBox.Visible)
|
||||
{
|
||||
_textBox.Invalidate();
|
||||
}
|
||||
|
@ -360,6 +364,10 @@ namespace Greenshot.Drawing
|
|||
/// </summary>
|
||||
protected void UpdateFormat()
|
||||
{
|
||||
if (_textBox == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
string fontFamily = GetFieldValueAsString(FieldType.FONT_FAMILY);
|
||||
bool fontBold = GetFieldValueAsBool(FieldType.FONT_BOLD);
|
||||
bool fontItalic = GetFieldValueAsBool(FieldType.FONT_ITALIC);
|
||||
|
@ -441,7 +449,7 @@ namespace Greenshot.Drawing
|
|||
{
|
||||
return;
|
||||
}
|
||||
StringAlignment alignment = (StringAlignment)GetFieldValue(FieldType.TEXT_HORIZONTAL_ALIGNMENT);
|
||||
var alignment = (StringAlignment)GetFieldValue(FieldType.TEXT_HORIZONTAL_ALIGNMENT);
|
||||
switch (alignment)
|
||||
{
|
||||
case StringAlignment.Near:
|
||||
|
@ -455,7 +463,7 @@ namespace Greenshot.Drawing
|
|||
break;
|
||||
}
|
||||
|
||||
Color lineColor = GetFieldValueAsColor(FieldType.LINE_COLOR);
|
||||
var lineColor = GetFieldValueAsColor(FieldType.LINE_COLOR);
|
||||
_textBox.ForeColor = lineColor;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue