From 759f4f39e3fdde1f9ed8b620af51e05d052d8964 Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Fri, 5 Feb 2016 18:36:22 +0100 Subject: Textbox and Label: insert linebreak, update size if Fit --- src/GraphicObjects/Label.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/GraphicObjects/Label.cs') diff --git a/src/GraphicObjects/Label.cs b/src/GraphicObjects/Label.cs index ee7dd045..d8d214c7 100644 --- a/src/GraphicObjects/Label.cs +++ b/src/GraphicObjects/Label.cs @@ -271,7 +271,17 @@ namespace Crow CurrentColumn += str.Length; NotifyValueChanged ("Text", Text); } - + /// + /// Insert a line break. + /// + protected void InsertLineBreak() + { + lines.Insert(CurrentLine + 1, lines[CurrentLine].Substring(CurrentColumn)); + lines [CurrentLine] = lines [CurrentLine].Substring (0, CurrentColumn); + CurrentLine++; + CurrentColumn = 0; + NotifyValueChanged ("Text", Text); + } #region GraphicObject overrides [XmlAttributeAttribute()][DefaultValue(-1)] public override int Width { -- cgit v1.3.1-4-g156e