|
@@ -26,6 +26,7 @@ type
|
|
TVectorialFillInterface = class(TComponent)
|
|
TVectorialFillInterface = class(TComponent)
|
|
private
|
|
private
|
|
FCanEditGradTexPoints: boolean;
|
|
FCanEditGradTexPoints: boolean;
|
|
|
|
+ FIsTarget: boolean;
|
|
FOnMouseDown: TMouseEvent;
|
|
FOnMouseDown: TMouseEvent;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
@@ -37,6 +38,7 @@ type
|
|
{%H-}Shift: TShiftState; X, {%H-}Y: Integer);
|
|
{%H-}Shift: TShiftState; X, {%H-}Y: Integer);
|
|
procedure SetCanEditGradTexPoints(AValue: boolean);
|
|
procedure SetCanEditGradTexPoints(AValue: boolean);
|
|
procedure SetEditingGradTexPoints(AValue: boolean);
|
|
procedure SetEditingGradTexPoints(AValue: boolean);
|
|
|
|
+ procedure SetIsTarget(AValue: boolean);
|
|
procedure SetVerticalPadding(AValue: integer);
|
|
procedure SetVerticalPadding(AValue: integer);
|
|
procedure ToolbarMouseDown(Sender: TObject; Button: TMouseButton;
|
|
procedure ToolbarMouseDown(Sender: TObject; Button: TMouseButton;
|
|
Shift: TShiftState; X, Y: Integer);
|
|
Shift: TShiftState; X, Y: Integer);
|
|
@@ -182,6 +184,7 @@ type
|
|
function CreateShapeFill(AShape: TVectorShape): TVectorialFill;
|
|
function CreateShapeFill(AShape: TVectorShape): TVectorialFill;
|
|
procedure UpdateShapeFill(AShape: TVectorShape; ATarget: TLCFillTarget);
|
|
procedure UpdateShapeFill(AShape: TVectorShape; ATarget: TLCFillTarget);
|
|
property FillType: TVectorialFillType read FFillType write SetFillType;
|
|
property FillType: TVectorialFillType read FFillType write SetFillType;
|
|
|
|
+ property IsTarget: boolean read FIsTarget write SetIsTarget;
|
|
property SolidColor: TBGRAPixel read FSolidColor write SetSolidColor;
|
|
property SolidColor: TBGRAPixel read FSolidColor write SetSolidColor;
|
|
property AverageColor: TBGRAPixel read GetAverageColor;
|
|
property AverageColor: TBGRAPixel read GetAverageColor;
|
|
property GradientType: TGradientType read FGradType write SetGradientType;
|
|
property GradientType: TGradientType read FGradType write SetGradientType;
|
|
@@ -486,7 +489,13 @@ begin
|
|
grad.Free;
|
|
grad.Free;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
- bmp.Rectangle(bmp.ClipRect, BGRA(0,0,0,128), dmDrawWithTransparency);
|
|
|
|
|
|
+ if IsTarget then
|
|
|
|
+ begin
|
|
|
|
+ if bmp.GetPixel(bmp.Width/2,bmp.Height/2).Lightness > 20000 then
|
|
|
|
+ bmp.Rectangle(bmp.ClipRect, BGRABlack, dmDrawWithTransparency)
|
|
|
|
+ else bmp.Rectangle(bmp.ClipRect, CSSSilver, dmDrawWithTransparency);
|
|
|
|
+ end
|
|
|
|
+ else bmp.Rectangle(bmp.ClipRect, BGRA(0,0,0,128), dmDrawWithTransparency);
|
|
bmpCopy := bmp.MakeBitmapCopy(clBtnFace);
|
|
bmpCopy := bmp.MakeBitmapCopy(clBtnFace);
|
|
bmp.Free;
|
|
bmp.Free;
|
|
FPreview.Picture.Assign(bmpCopy);
|
|
FPreview.Picture.Assign(bmpCopy);
|
|
@@ -1152,6 +1161,13 @@ begin
|
|
FButtonEditGradTexPoints.Down := AValue;
|
|
FButtonEditGradTexPoints.Down := AValue;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TVectorialFillInterface.SetIsTarget(AValue: boolean);
|
|
|
|
+begin
|
|
|
|
+ if FIsTarget=AValue then Exit;
|
|
|
|
+ FIsTarget:=AValue;
|
|
|
|
+ UpdatePreview;
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TVectorialFillInterface.ToolbarMouseEnter(Sender: TObject);
|
|
procedure TVectorialFillInterface.ToolbarMouseEnter(Sender: TObject);
|
|
begin
|
|
begin
|
|
If Assigned(FOnMouseEnter) then FOnMouseEnter(self);
|
|
If Assigned(FOnMouseEnter) then FOnMouseEnter(self);
|