Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
authorMike Krüger <mkrueger@xamarin.com>2013-08-22 13:01:24 +0400
committerMike Krüger <mkrueger@xamarin.com>2013-08-22 13:01:24 +0400
commit27194f1466e6512c5d1f98275397b193dfa536b6 (patch)
tree5e5472ca2b2e6c787fa6dc66341fcc32e30ea9f6 /main/src
parentf38ae79fe64ce3410218cc8afccc5e23e2a01144 (diff)
[TextEditor] fixed column calculation.
Diffstat (limited to 'main/src')
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs8
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)