Adds support to join style and endcap in TFPCustomPen in fcl-image

git-svn-id: trunk@23297 -
This commit is contained in:
sekelsenmat 2013-01-02 14:28:09 +00:00
parent 21d62277ce
commit b0980b342d
2 changed files with 30 additions and 0 deletions

View File

@ -114,6 +114,18 @@ type
pmMergePenNot, pmMaskPenNot, pmMergeNotPen, pmMaskNotPen, pmMerge,
pmNotMerge, pmMask, pmNotMask, pmXor, pmNotXor);
TPenPattern = Longword;
TFPPenEndCap = (
pecRound,
pecSquare,
pecFlat
);
TFPPenJoinStyle = (
pjsRound,
pjsBevel,
pjsMiter
);
{ TFPCustomPen }
TFPCustomPen = class (TFPCanvasHelper)
private
@ -121,12 +133,16 @@ type
FWidth : Integer;
FMode : TFPPenMode;
FPattern : longword;
FEndCap: TFPPenEndCap;
FJoinStyle: TFPPenJoinStyle;
protected
procedure DoCopyProps (From:TFPCanvasHelper); override;
procedure SetMode (AValue : TFPPenMode); virtual;
procedure SetWidth (AValue : Integer); virtual;
procedure SetStyle (AValue : TFPPenStyle); virtual;
procedure SetPattern (AValue : longword); virtual;
procedure SetEndCap(AValue: TFPPenEndCap); virtual;
procedure SetJoinStyle(AValue: TFPPenJoinStyle); virtual;
public
function CopyPen : TFPCustomPen;
// Creates a copy of the pen with all properties the same, but not allocated
@ -134,6 +150,8 @@ type
property Width : Integer read FWidth write SetWidth;
property Mode : TFPPenMode read FMode write SetMode;
property Pattern : longword read FPattern write SetPattern;
property EndCap : TFPPenEndCap read FEndCap write SetEndCap;
property JoinStyle : TFPPenJoinStyle read FJoinStyle write SetJoinStyle;
end;
TFPCustomPenClass = class of TFPCustomPen;

View File

@ -37,6 +37,18 @@ begin
FPattern := AValue;
end;
procedure TFPCustomPen.SetEndCap(AValue: TFPPenEndCap);
begin
if FEndCap=AValue then Exit;
FEndCap:=AValue;
end;
procedure TFPCustomPen.SetJoinStyle(AValue: TFPPenJoinStyle);
begin
if FJoinStyle=AValue then Exit;
FJoinStyle:=AValue;
end;
procedure TFPCustomPen.DoCopyProps (From:TFPCanvasHelper);
begin
with From as TFPCustomPen do