mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2026-01-06 04:00:32 +01:00
gtk2: fix text drawing defects introcudced in r24628 #72259342cb
git-svn-id: trunk@24643 -
This commit is contained in:
parent
0f8d05eba0
commit
42558682c9
@ -47,6 +47,7 @@ var
|
||||
NewMatrix: TPangoMatrix;
|
||||
OldMatrix: PPangoMatrix;
|
||||
renderer: PGdkPangoRenderer;
|
||||
Direction : TPangoDirection;
|
||||
AFont: PGdiObject;
|
||||
|
||||
procedure SetColors(AFGColor, ABGColor: PGdkColor); inline;
|
||||
@ -61,6 +62,10 @@ begin
|
||||
AFont := GetFont;
|
||||
SetLayoutText(AFont^.GDIFontObject, AText, ALength);
|
||||
|
||||
WidgetCont := pango_layout_get_context(AFont^.GDIFontObject);
|
||||
Direction := pango_find_base_dir(AText, ALength);
|
||||
pango_context_set_base_dir(WidgetCont, Direction);
|
||||
|
||||
if AFont^.LogFont.lfEscapement <> 0 then
|
||||
begin
|
||||
if Widget <> nil then
|
||||
@ -71,8 +76,6 @@ begin
|
||||
gdk_pango_renderer_set_gc(renderer, GC);
|
||||
SetColors(FGColor, BGColor);
|
||||
|
||||
WidgetCont := pango_layout_get_context(AFont^.GDIFontObject);
|
||||
|
||||
OldMatrix := pango_context_get_matrix(WidgetCont);
|
||||
NewMatrix.xx := 1.0;
|
||||
NewMatrix.xy := 0.0;
|
||||
|
||||
@ -765,7 +765,6 @@ var
|
||||
DevCtx: TGtk2DeviceContext absolute DC;
|
||||
DCOrigin: TPoint;
|
||||
yOffset: integer;
|
||||
Direction : TPangoDirection;
|
||||
begin
|
||||
Result := IsValidDC(DC);
|
||||
if not Result then Exit;
|
||||
@ -786,9 +785,6 @@ begin
|
||||
DevCtx.SelectedColors := dcscCustom;
|
||||
EnsureGCColor(DC, dccCurrentTextColor, True, False);
|
||||
|
||||
Direction := pango_find_base_dir(Str, Count);
|
||||
pango_context_set_base_dir(@DevCtx, Direction);
|
||||
|
||||
DevCtx.DrawTextWithColors(Str, Count,
|
||||
X + DCOrigin.X, Y + DCOrigin.Y + yOffset,
|
||||
nil, nil);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user