diff options
Diffstat (limited to 'src/corelib/x11')
-rw-r--r-- | src/corelib/x11/fpg_x11.pas | 29 | ||||
-rw-r--r-- | src/corelib/x11/fpgui_toolkit.lpk | 6 | ||||
-rw-r--r-- | src/corelib/x11/fpgui_toolkit.pas | 2 |
3 files changed, 28 insertions, 9 deletions
diff --git a/src/corelib/x11/fpg_x11.pas b/src/corelib/x11/fpg_x11.pas index 4c7fa049..010fda63 100644 --- a/src/corelib/x11/fpg_x11.pas +++ b/src/corelib/x11/fpg_x11.pas @@ -195,6 +195,7 @@ type procedure SetPixel(X, Y: integer; const AValue: TfpgColor); override; procedure DoDrawArc(x, y, w, h: TfpgCoord; a1, a2: Extended); override; procedure DoFillArc(x, y, w, h: TfpgCoord; a1, a2: Extended); override; + procedure DoDrawPolygon(Points: PPoint; NumPts: Integer; Winding: boolean=False); override; property DCHandle: TfpgDCHandle read FDrawHandle; public constructor Create; override; @@ -1918,6 +1919,23 @@ begin Trunc(64 * a1), Trunc(64 * a2)); end; +procedure TfpgCanvasImpl.DoDrawPolygon(Points: fpg_base.PPoint; NumPts: Integer; Winding: boolean); +var + PointArray: PXPoint; + i: integer; +begin + { convert TPoint to TXPoint } + GetMem(PointArray, SizeOf(TXPoint)*(NumPts+1)); // +1 for return line + for i := 0 to NumPts-1 do + begin + PointArray[i].x := Points[i].x; + PointArray[i].y := Points[i].y; + end; + XFillPolygon(xapplication.display, FDrawHandle, Fgc, PointArray, NumPts, CoordModeOrigin, X.Complex); + if PointArray <> nil then + FreeMem(PointArray); +end; + procedure TfpgCanvasImpl.BufferFreeTimer(Sender: TObject); begin {$IFDEF DEBUG} @@ -2039,14 +2057,11 @@ procedure TfpgCanvasImpl.DoFillTriangle(x1, y1, x2, y2, x3, y3: TfpgCoord); var pts: array[1..3] of TXPoint; begin - pts[1].x := x1; - pts[1].y := y1; - pts[2].x := x2; - pts[2].y := y2; - pts[3].x := x3; - pts[3].y := y3; + pts[1].x := x1; pts[1].y := y1; + pts[2].x := x2; pts[2].y := y2; + pts[3].x := x3; pts[3].y := y3; - XFillPolygon(xapplication.display, FDrawHandle, Fgc, @pts, 3, 0, 0); + XFillPolygon(xapplication.display, FDrawHandle, Fgc, @pts, 3, CoordModeOrigin, X.Complex); end; procedure TfpgCanvasImpl.DoDrawRectangle(x, y, w, h: TfpgCoord); diff --git a/src/corelib/x11/fpgui_toolkit.lpk b/src/corelib/x11/fpgui_toolkit.lpk index 7329a3bb..55614af2 100644 --- a/src/corelib/x11/fpgui_toolkit.lpk +++ b/src/corelib/x11/fpgui_toolkit.lpk @@ -29,7 +29,7 @@ <License Value="Modified LGPL "/> <Version Minor="6" Release="3"/> - <Files Count="72"> + <Files Count="73"> <Item1> <Filename Value="../stdimages.inc"/> <Type Value="Include"/> @@ -318,6 +318,10 @@ <Filename Value="../../gui/fpg_spinedit.pas"/> <UnitName Value="fpg_spinedit"/> </Item72> + <Item73> + <Filename Value="../fpg_extgraphics.pas"/> + <UnitName Value="fpg_extgraphics"/> + </Item73> </Files> <LazDoc Paths="../../../docs/xml/corelib/;../../../docs/xml/corelib/x11/;../../../docs/xml/corelib/gdi/;../../../docs/xml/gui/"/> <RequiredPkgs Count="1"> diff --git a/src/corelib/x11/fpgui_toolkit.pas b/src/corelib/x11/fpgui_toolkit.pas index 953d2aa1..b7c3da23 100644 --- a/src/corelib/x11/fpgui_toolkit.pas +++ b/src/corelib/x11/fpgui_toolkit.pas @@ -17,7 +17,7 @@ uses fpg_iniutils, fpg_label, fpg_listbox, fpg_listview, fpg_memo, fpg_menu, fpg_mru, fpg_panel, fpg_popupcalendar, fpg_progressbar, fpg_radiobutton, fpg_scrollbar, fpg_style, fpg_tab, fpg_trackbar, fpg_tree, fpgui_db, - fpg_splitter, fpg_hint, fpg_spinedit; + fpg_splitter, fpg_hint, fpg_spinedit, fpg_extgraphics; implementation |