Changeset 115 for trunk/UGame.pas
- Timestamp:
- Dec 10, 2016, 3:52:26 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UGame.pas
r106 r115 139 139 140 140 TCanvasEx = class(TCanvas) 141 procedure TextOutEx(X,Y: Integer; const Text: string; MovePen: Boolean = True);142 procedure PolygonEx(const Points: array of TPoint; Winding: Boolean);141 class procedure TextOutEx(Canvas: TCanvas; X,Y: Integer; const Text: string; MovePen: Boolean = True); 142 class procedure PolygonEx(Canvas: TCanvas; const Points: array of TPoint; Winding: Boolean); 143 143 end; 144 144 … … 874 874 { TCanvasEx } 875 875 876 procedure TCanvasEx.TextOutEx(X, Y: Integer; const Text: string;876 class procedure TCanvasEx.TextOutEx(Canvas: TCanvas; X, Y: Integer; const Text: string; 877 877 MovePen: Boolean); 878 878 var 879 879 Flags : Cardinal; 880 880 begin 881 Changing; 882 RequiredState([csHandleValid, csFontValid, csBrushValid]); 883 Flags := 0; 884 if TextStyle.Opaque then 885 Flags := ETO_Opaque; 886 ExtUTF8Out(Handle, X, Y, Flags, nil, PChar(Text), Length(Text), nil); 887 if MovePen then MoveTo(X + TextWidth(Text), Y); 888 Changed; 889 end; 890 891 procedure TCanvasEx.PolygonEx(const Points: array of TPoint; Winding: Boolean); 881 with Canvas do begin 882 Changing; 883 RequiredState([csHandleValid, csFontValid, csBrushValid]); 884 Flags := 0; 885 if TextStyle.Opaque then 886 Flags := ETO_Opaque; 887 ExtUTF8Out(Handle, X, Y, Flags, nil, PChar(Text), Length(Text), nil); 888 if MovePen then MoveTo(X + TextWidth(Text), Y); 889 Changed; 890 end; 891 end; 892 893 class procedure TCanvasEx.PolygonEx(Canvas: TCanvas; const Points: array of TPoint; Winding: Boolean); 892 894 begin 893 895 //Changing; 894 896 //RequiredState([csHandleValid, csBrushValid, csPenValid]); 895 LCLIntf.Polygon( Handle, @Points[0], Length(Points), Winding);897 LCLIntf.Polygon(Canvas.Handle, @Points[0], Length(Points), Winding); 896 898 //Changed; 897 899 end; … … 1297 1299 Brush.Style := bsSolid; 1298 1300 //Polygon(Points, False, 0, Length(Points)); 1299 TCanvasEx (Canvas).PolygonEx(Points, False);1301 TCanvasEx.PolygonEx(Canvas, Points, False); 1300 1302 //MoveTo(Points[0].X, Points[0].Y); 1301 1303 //LineTo(Points[1].X, Points[1].Y); … … 1309 1311 TextPos := View.CellToCanvasPos(Pos); 1310 1312 TextSize := TextExtent(Text); 1311 TCanvasEx (Canvas).TextOutEx(Round(TextPos.X) - TextSize.cx div 2,1313 TCanvasEx.TextOutEx(Canvas, Round(TextPos.X) - TextSize.cx div 2, 1312 1314 Round(TextPos.Y) - TextSize.cy div 2, Text, False); 1313 1315 end;
Note:
See TracChangeset
for help on using the changeset viewer.