mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-11 14:20:02 +02:00
fix(?) DCOffset for DrawText
git-svn-id: trunk@4635 -
This commit is contained in:
parent
426aa21c73
commit
b0a03ccf54
@ -122,6 +122,7 @@ var
|
|||||||
Attr : PPangoAttribute;
|
Attr : PPangoAttribute;
|
||||||
RGBColor : TColor;
|
RGBColor : TColor;
|
||||||
X, Y, Width, Height : Integer;
|
X, Y, Width, Height : Integer;
|
||||||
|
DCOrigin: TPoint;
|
||||||
begin
|
begin
|
||||||
if (Str=nil) or (Str[0]=#0) then exit;
|
if (Str=nil) or (Str[0]=#0) then exit;
|
||||||
Assert(False, Format('trace:> [Tgtk2Object.DrawText] DC:0x%x, Str:''%s'', Count: %d, Rect = %d,%d,%d,%d, Flags:%d',
|
Assert(False, Format('trace:> [Tgtk2Object.DrawText] DC:0x%x, Str:''%s'', Count: %d, Rect = %d,%d,%d,%d, Flags:%d',
|
||||||
@ -138,10 +139,15 @@ begin
|
|||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
if (Str<>nil) and (Count>0) then begin
|
if (Str<>nil) and (Count>0) then begin
|
||||||
if (CurrentFont = nil) or (CurrentFont^.GDIFontObject = nil) then
|
if (CurrentFont = nil) or (CurrentFont^.GDIFontObject = nil) or
|
||||||
|
((Flags and DT_INTERNAL) = DT_INTERNAL)
|
||||||
|
then
|
||||||
UseFontDesc := GetDefaultFontDesc(false)
|
UseFontDesc := GetDefaultFontDesc(false)
|
||||||
else
|
else
|
||||||
UseFontDesc := CurrentFont^.GDIFontObject;
|
UseFontDesc := CurrentFont^.GDIFontObject;
|
||||||
|
|
||||||
|
DCOrigin:=GetDCOffset(TDeviceContext(DC));
|
||||||
|
|
||||||
GetStyle('default');
|
GetStyle('default');
|
||||||
Layout := gtk_widget_create_pango_layout (GetStyleWidget('default'), nil);
|
Layout := gtk_widget_create_pango_layout (GetStyleWidget('default'), nil);
|
||||||
pango_layout_set_font_description(Layout, UseFontDesc);
|
pango_layout_set_font_description(Layout, UseFontDesc);
|
||||||
@ -224,7 +230,7 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
gdk_draw_layout(drawable, gc, X, Y, Layout);
|
gdk_draw_layout(drawable, gc, X+DCOrigin.X, Y+DCOrigin.Y, Layout);
|
||||||
g_object_unref(Layout);
|
g_object_unref(Layout);
|
||||||
Result := 0;
|
Result := 0;
|
||||||
end;
|
end;
|
||||||
@ -1040,6 +1046,9 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.14 2003/09/17 20:30:57 ajgenius
|
||||||
|
fix(?) DCOffset for DrawText
|
||||||
|
|
||||||
Revision 1.13 2003/09/17 19:40:46 ajgenius
|
Revision 1.13 2003/09/17 19:40:46 ajgenius
|
||||||
Initial DoubleBuffering Support for GTK2
|
Initial DoubleBuffering Support for GTK2
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user