mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 05:23:24 -07:00
Fix for bug [#1457]
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2463 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
1b95405fa9
commit
c6f3438a16
1 changed files with 10 additions and 4 deletions
|
@ -35,14 +35,19 @@ namespace Greenshot.Drawing {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents a textbox (extends RectangleContainer for border/background support
|
/// Represents a textbox (extends RectangleContainer for border/background support
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Serializable()]
|
[Serializable]
|
||||||
public class TextContainer : RectangleContainer, ITextContainer {
|
public class TextContainer : RectangleContainer, ITextContainer {
|
||||||
private bool fontInvalidated = true;
|
private bool fontInvalidated = true;
|
||||||
// If makeUndoable is true the next text-change will make the change undoable.
|
// If makeUndoable is true the next text-change will make the change undoable.
|
||||||
// This is set to true AFTER the first change is made, as there is already a "add element" on the undo stack
|
// This is set to true AFTER the first change is made, as there is already a "add element" on the undo stack
|
||||||
private bool makeUndoable = false;
|
private bool makeUndoable = false;
|
||||||
private Font font;
|
private Font font;
|
||||||
StringFormat stringFormat = new StringFormat();
|
|
||||||
|
/// <summary>
|
||||||
|
/// The StringFormat object is not serializable!!
|
||||||
|
/// </summary>
|
||||||
|
[NonSerialized]
|
||||||
|
StringFormat stringFormat;
|
||||||
|
|
||||||
private string text;
|
private string text;
|
||||||
// there is a binding on the following property!
|
// there is a binding on the following property!
|
||||||
|
@ -79,12 +84,13 @@ namespace Greenshot.Drawing {
|
||||||
AddField(GetType(), FieldType.FONT_SIZE, 11f);
|
AddField(GetType(), FieldType.FONT_SIZE, 11f);
|
||||||
AddField(GetType(), FieldType.TEXT_HORIZONTAL_ALIGNMENT, HorizontalAlignment.Center);
|
AddField(GetType(), FieldType.TEXT_HORIZONTAL_ALIGNMENT, HorizontalAlignment.Center);
|
||||||
AddField(GetType(), FieldType.TEXT_VERTICAL_ALIGNMENT, VerticalAlignment.CENTER);
|
AddField(GetType(), FieldType.TEXT_VERTICAL_ALIGNMENT, VerticalAlignment.CENTER);
|
||||||
|
stringFormat = new StringFormat();
|
||||||
stringFormat.Trimming = StringTrimming.EllipsisWord;
|
stringFormat.Trimming = StringTrimming.EllipsisWord;
|
||||||
}
|
}
|
||||||
|
|
||||||
[OnDeserializedAttribute()]
|
[OnDeserializedAttribute]
|
||||||
private void OnDeserialized(StreamingContext context) {
|
private void OnDeserialized(StreamingContext context) {
|
||||||
|
stringFormat = new StringFormat();
|
||||||
Init();
|
Init();
|
||||||
UpdateFormat();
|
UpdateFormat();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue