mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-10 12:48:17 +02:00
gtk1/2 intf: fixed Arc
git-svn-id: trunk@9472 -
This commit is contained in:
parent
486838638b
commit
9b52c9bc1d
@ -978,7 +978,7 @@ type
|
||||
NumPts: Integer = -1);
|
||||
procedure Polygon(Points: PPoint; NumPts: Integer;
|
||||
Winding: boolean = False); virtual;
|
||||
Procedure Polygon(const Points: array of TPoint); // already in fpcanvas
|
||||
procedure Polygon(const Points: array of TPoint); // already in fpcanvas
|
||||
procedure Polyline(const Points: array of TPoint;
|
||||
StartIndex: Integer;
|
||||
NumPts: Integer = -1);
|
||||
|
@ -36,7 +36,8 @@ begin
|
||||
Result := False;
|
||||
Points := nil;
|
||||
Count := 0;
|
||||
PolyBezierArcPoints(Left, Top, Right-Left, Bottom-Top, Angle1, Angle2, 0, Points, Count);
|
||||
PolyBezierArcPoints(Left, Top, Right-Left, Bottom-Top, Angle1, Angle2, 0,
|
||||
Points, Count);
|
||||
Polygon(DC, Points, Count, False);
|
||||
ReallocMem(Points, 0);
|
||||
Result := True;
|
||||
@ -1451,4 +1452,4 @@ begin
|
||||
Result := 0;
|
||||
end;
|
||||
|
||||
//##apiwiz##eps## // Do not remove
|
||||
//##apiwiz##eps## // Do not remove
|
||||
|
@ -165,7 +165,7 @@ var
|
||||
ImgIndex: integer;
|
||||
TS: TTextStyle;
|
||||
begin
|
||||
//DebugLn('TToolButton.Paint A ',Name,' FToolBar=',DbgS(FToolBar),' ',ClientWidth,',',ClientHeight,' ',ord(Style));
|
||||
//DebugLn(['TToolButton.Paint A ',DbgSName(Self),' FToolBar=',DbgSName(FToolBar),' ',ClientWidth,',',ClientHeight,' ',ord(Style)]);
|
||||
if (FToolBar<>nil) and (ClientWidth>0) and (ClientHeight>0) then begin
|
||||
PaintRect:=ClientRect; // the whole paint area
|
||||
|
||||
|
@ -48,6 +48,9 @@ const
|
||||
circle equals 5760 (16*360). Positive values of Angle and AngleLength mean
|
||||
counter-clockwise while negative values mean clockwise direction.
|
||||
Zero degrees is at the 3'o clock position.
|
||||
Angle1 is the starting angle. Angle2 is relative to Angle1 (added).
|
||||
Example:
|
||||
Angle1 = 10*16, Angle2 = 30*16 will draw an arc from 10 to 40 degree.
|
||||
|
||||
------------------------------------------------------------------------------}
|
||||
function TGtkWidgetSet.Arc(DC: HDC;
|
||||
@ -75,9 +78,11 @@ begin
|
||||
DCOrigin:=GetDCOffset(TDeviceContext(DC));
|
||||
inc(Left,DCOrigin.X);
|
||||
inc(Top,DCOrigin.Y);
|
||||
inc(Right,DCOrigin.X);
|
||||
inc(Bottom,DCOrigin.Y);
|
||||
{$IFDEF DebugGDKTraps}BeginGDKErrorTrap;{$ENDIF}
|
||||
gdk_draw_arc(Drawable, GC, 0, left, top, right - left, bottom - top,
|
||||
Angle1 shl 2, Angle2 shl 2);
|
||||
Angle1*4, Angle2*4);
|
||||
{$IFDEF DebugGDKTraps}EndGDKErrorTrap;{$ENDIF}
|
||||
end else
|
||||
Result:=false;
|
||||
|
Loading…
Reference in New Issue
Block a user