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:
zeljko 2010-11-22 15:05:31 +00:00
parent f72651e6f0
commit 383b0064f2
2 changed files with 20 additions and 5 deletions

View File

@ -525,7 +525,7 @@ type
{ TShape }
TShapeType = (stRectangle, stSquare, stRoundRect, stRoundSquare,
stEllipse, stCircle, stSquaredDiamond, stDiamond);
stEllipse, stCircle, stSquaredDiamond, stDiamond, stTriangle);
TShape = class(TGraphicControl)
private

View File

@ -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;