mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-27 21:29:54 +02:00
LCL: TShape: fixed stDiamond cutted Edges, added stTriangle shape.Patch by u-boot. Fixes issue #16285
git-svn-id: trunk@28407 -
This commit is contained in:
parent
f72651e6f0
commit
383b0064f2
@ -525,7 +525,7 @@ type
|
||||
{ TShape }
|
||||
|
||||
TShapeType = (stRectangle, stSquare, stRoundRect, stRoundSquare,
|
||||
stEllipse, stCircle, stSquaredDiamond, stDiamond);
|
||||
stEllipse, stCircle, stSquaredDiamond, stDiamond, stTriangle);
|
||||
|
||||
TShape = class(TGraphicControl)
|
||||
private
|
||||
|
@ -72,14 +72,29 @@ begin
|
||||
begin
|
||||
with Self do
|
||||
begin
|
||||
P[0].x := 0;
|
||||
P[0].x := PenInc;
|
||||
P[0].y := (Height - 1) div 2;
|
||||
P[1].x := (Width - 1) div 2;
|
||||
P[1].y := 0;
|
||||
P[2].x := Width - 1;
|
||||
P[1].y := PenInc;
|
||||
P[2].x := Width - PenInc - 1;
|
||||
P[2].y := P[0].y;
|
||||
P[3].x := P[1].x;
|
||||
P[3].y := Height - 1;
|
||||
P[3].y := Height - PenInc - 1;
|
||||
Polygon(P);
|
||||
end;
|
||||
end;
|
||||
stTriangle:
|
||||
begin
|
||||
with Self do
|
||||
begin
|
||||
P[0].x := (Width - 1) div 2;
|
||||
P[0].y := PenInc;
|
||||
P[1].x := Width - PenInc - 1;
|
||||
P[1].y := Height - PenInc - 1;
|
||||
P[2].x := PenInc;
|
||||
P[2].y := Height - PenInc - 1;
|
||||
P[3].x := P[0].x;
|
||||
P[3].y := P[0].y;
|
||||
Polygon(P);
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user