diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2013-08-22 13:01:24 +0400 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2013-08-22 13:01:24 +0400 |
commit | 27194f1466e6512c5d1f98275397b193dfa536b6 (patch) | |
tree | 5e5472ca2b2e6c787fa6dc66341fcc32e30ea9f6 /main/src/core/Mono.Texteditor | |
parent | f38ae79fe64ce3410218cc8afccc5e23e2a01144 (diff) |
[TextEditor] fixed column calculation.
Diffstat (limited to 'main/src/core/Mono.Texteditor')
-rw-r--r-- | main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs index 8bfceea160..ee83ac7b7d 100644 --- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs +++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs @@ -3031,12 +3031,14 @@ namespace Mono.TextEditor return 0; var wrapper = GetLayout (line); - Pango.Rectangle inkrect, logicalrect; - wrapper.Layout.GetExtents (out inkrect, out logicalrect); + uint curIndex = 0; + uint byteIndex = 0; + + var pos = wrapper.Layout.IndexToPos ((int)TranslateToUTF8Index (wrapper.LineChars, (uint)column, ref curIndex, ref byteIndex)); if (wrapper.IsUncached) wrapper.Dispose (); - return (logicalrect.Width + Pango.Scale.PangoScale - 1) / Pango.Scale.PangoScale; + return (pos.X + Pango.Scale.PangoScale - 1) / Pango.Scale.PangoScale; } public int YToLine (double yPos) |