From 650a6ec0c5f3c4c37e5a2c20fe6eac5eeacf09e3 Mon Sep 17 00:00:00 2001 From: mattias Date: Sun, 23 Jan 2005 11:43:38 +0000 Subject: [PATCH] fixed expandingtabs in synedit painting git-svn-id: trunk@6668 - --- components/synedit/synedit.pp | 7 ++++-- lcl/interfaces/gtk2/gtk2int.pas | 16 ++++++++----- lcl/interfaces/gtk2/gtk2object.inc | 17 ++++--------- lcl/interfaces/gtk2/gtk2winapi.inc | 38 +++--------------------------- 4 files changed, 22 insertions(+), 56 deletions(-) diff --git a/components/synedit/synedit.pp b/components/synedit/synedit.pp index 4224a02139..ad7b88bfd1 100644 --- a/components/synedit/synedit.pp +++ b/components/synedit/synedit.pp @@ -2726,7 +2726,7 @@ var SetLength(ExpandedPaintToken,LengthNeeded+CharsInWindow); SrcPos:=0; DestPos:=0; - ScreenPos:=1; + ScreenPos:=PhysicalStartPos; Dest:=PChar(ExpandedPaintToken); while SrcPos write as one block - //fix me... do we even need to do it this way with pango? - DoTextOut(TxtPt.X, TxtPt.Y, LineStart, LineLen); - end else begin - // dist array -> write each char separately - CharsWritten:=integer(LineStart-Str); - if DCTextMetric.IsDoubleByteChar then - CharsWritten:=CharsWritten div 2; - CurDistX:=Dx+CharsWritten*SizeOf(Integer); - CurX:=TxtPt.X; - LinePos:=LineStart; - for i:=1 to LineLen do begin - //fix me... do we even need to do it this way with pango? - DoTextOut(CurX, TxtPt.Y, LinePos, 1); - inc(LinePos); - inc(CurX,CurDistX^); - inc(CurDistX); - end; - end; -{$ELSE GTK1} DoTextOut(TxtPt.X, TxtPt.Y, LineStart, LineLen); -{$ENDIF GTK1} end; end; @@ -615,9 +584,6 @@ end; function TGtk2WidgetSet.GetTextExtentPoint(DC: HDC; Str: PChar; Count: Integer; var Size: TSize): Boolean; var - DCOrigin: TPoint; - aRect : TRect; - UnRef, Underline, StrikeOut : Boolean; @@ -650,7 +616,6 @@ begin If UseFontDesc = nil then DebugLn('WARNING: [TGtk2WidgetSet.GetTextExtentPoint] Missing Font') else begin - DCOrigin:=GetDCOffset(TDeviceContext(DC)); GetStyle(lgsdefault); Layout := gtk_widget_create_pango_layout (GetStyleWidget(lgsdefault), nil); pango_layout_set_font_description(Layout, UseFontDesc); @@ -830,6 +795,9 @@ end; { ============================================================================= $Log$ + Revision 1.12 2005/01/23 11:43:38 mattias + fixed expandingtabs in synedit painting + Revision 1.11 2004/11/08 19:11:55 mattias disabled hardly used gtk FillScreenFont, this should be only done on demand, improved getting default font family for gtk