From 27194f1466e6512c5d1f98275397b193dfa536b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Kr=C3=BCger?= Date: Thu, 22 Aug 2013 11:01:24 +0200 Subject: [TextEditor] fixed column calculation. --- .../core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'main/src') 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) -- cgit v1.2.3