|
@@ -35,9 +35,10 @@ const
|
|
|
function StrToPaintToolType(const s: ansistring): TPaintToolType;
|
|
|
|
|
|
type
|
|
|
- TContextualToolbar = (ctPenFill, ctBackFill, ctPenWidth, ctPenStyle, ctAliasing, ctShape, ctEraserOption, ctTolerance,
|
|
|
- ctDeformation, ctCloseShape, ctLineCap, ctJoinStyle, ctSplineStyle, ctText, ctTextShadow,
|
|
|
- ctPhong, ctAltitude, ctPerspective, ctBrush, ctRatio);
|
|
|
+ TContextualToolbar = (ctPenFill, ctPenWidth, ctPenStyle, ctJoinStyle, ctLineCap,
|
|
|
+ ctCloseShape, ctSplineStyle, ctShape, ctRatio, ctBackFill,
|
|
|
+ ctBrush, ctEraserOption, ctAliasing, ctTolerance, ctDeformation, ctPerspective,
|
|
|
+ ctText, ctOutlineWidth, ctOutlineFill, ctTextShadow, ctPhong, ctAltitude);
|
|
|
TContextualToolbars = set of TContextualToolbar;
|
|
|
|
|
|
type
|
|
@@ -47,7 +48,8 @@ type
|
|
|
TEraserMode = (emEraseAlpha, emSharpen, emSoften, emLighten, emDarken);
|
|
|
TToolCommand = (tcCut, tcCopy, tcPaste, tcDelete, tcFinish, tcMoveUp, tcMoveDown, tcMoveToFront, tcMoveToBack,
|
|
|
tcAlignLeft, tcCenterHorizontally, tcAlignRight, tcAlignTop, tcCenterVertically, tcAlignBottom,
|
|
|
- tcShapeToSpline, tcForeAdjustToShape, tcBackAdjustToShape, tcForeEditGradTexPoints, tcBackEditGradTexPoints);
|
|
|
+ tcShapeToSpline, tcForeAdjustToShape, tcBackAdjustToShape, tcOutlineAdjustToShape,
|
|
|
+ tcForeEditGradTexPoints, tcBackEditGradTexPoints, tcOutlineEditGradTexPoints);
|
|
|
|
|
|
TDeformationGridMode = (gmDeform, gmMovePointWithoutDeformation);
|
|
|
|
|
@@ -100,8 +102,10 @@ type
|
|
|
function GetCurrentLayerKind: TLayerKind;
|
|
|
function GetIsForeEditGradTexPoints: boolean; virtual;
|
|
|
function GetIsBackEditGradTexPoints: boolean; virtual;
|
|
|
+ function GetIsOutlineEditGradTexPoints: boolean; virtual;
|
|
|
function GetAllowedBackFillTypes: TVectorialFillTypes; virtual;
|
|
|
function GetAllowedForeFillTypes: TVectorialFillTypes; virtual;
|
|
|
+ function GetAllowedOutlineFillTypes: TVectorialFillTypes; virtual;
|
|
|
property ShiftState: TShiftState read FShiftState;
|
|
|
public
|
|
|
ToolUpdateNeeded: boolean;
|
|
@@ -142,8 +146,10 @@ type
|
|
|
property ForeUniversalBrush: TUniversalBrush read GetForeUniversalBrush;
|
|
|
property IsForeEditGradTexPoints: boolean read GetIsForeEditGradTexPoints;
|
|
|
property IsBackEditGradTexPoints: boolean read GetIsBackEditGradTexPoints;
|
|
|
+ property IsOutlineEditGradTexPoints: boolean read GetIsOutlineEditGradTexPoints;
|
|
|
property AllowedForeFillTypes: TVectorialFillTypes read GetAllowedForeFillTypes;
|
|
|
property AllowedBackFillTypes: TVectorialFillTypes read GetAllowedBackFillTypes;
|
|
|
+ property AllowedOutlineFillTypes: TVectorialFillTypes read GetAllowedOutlineFillTypes;
|
|
|
end;
|
|
|
|
|
|
{ TReadonlyTool }
|
|
@@ -192,11 +198,12 @@ type
|
|
|
FSleepingToolType: TPaintToolType;
|
|
|
FReturnValidatesHintShown: boolean;
|
|
|
FOnToolChangedHandler: TOnToolChangedHandler;
|
|
|
+ FOnToolRenderChanged: TNotifyEvent;
|
|
|
FOnToolbarChanged: TNotifyEvent;
|
|
|
FOnPopupToolHandler: TOnPopupToolHandler;
|
|
|
|
|
|
- FForeFill, FBackFill: TVectorialFill;
|
|
|
- FForeLastGradient, FBackLastGradient: TBGRALayerGradientOriginal;
|
|
|
+ FForeFill, FBackFill, FOutlineFill: TVectorialFill;
|
|
|
+ FForeLastGradient, FBackLastGradient, FOutlineLastGradient: TBGRALayerGradientOriginal;
|
|
|
FEraserMode: TEraserMode;
|
|
|
FEraserAlpha: byte;
|
|
|
FBrushInfoList: TList;
|
|
@@ -252,10 +259,11 @@ type
|
|
|
FOnFloodFillOptionChanged: TNotifyEvent;
|
|
|
FOnPerspectiveOptionChanged: TNotifyEvent;
|
|
|
|
|
|
- procedure BackFillChange({%H-}ASender: TObject;
|
|
|
+ procedure FillChange(ASender: TObject;
|
|
|
var {%H-}ADiff: TCustomVectorialFillDiff);
|
|
|
function GetAllowedBackFillTypes: TVectorialFillTypes;
|
|
|
function GetAllowedForeFillTypes: TVectorialFillTypes;
|
|
|
+ function GetAllowedOutlineFillTypes: TVectorialFillTypes;
|
|
|
function GetCursor: TCursor;
|
|
|
function GetBackColor: TBGRAPixel;
|
|
|
function GetBrushAt(AIndex: integer): TLazPaintBrush;
|
|
@@ -263,19 +271,19 @@ type
|
|
|
function GetBrushInfo: TLazPaintBrush;
|
|
|
function GetForeColor: TBGRAPixel;
|
|
|
function GetMaxDeformationGridSize: TSize;
|
|
|
+ function GetOutlineColor: TBGRAPixel;
|
|
|
function GetShapeOptionAliasing: boolean;
|
|
|
function GetPenWidth: single;
|
|
|
function GetToolSleeping: boolean;
|
|
|
function GetTextFontName: string;
|
|
|
function GetTextFontSize: single;
|
|
|
function GetTextFontStyle: TFontStyles;
|
|
|
- procedure ForeFillChange({%H-}ASender: TObject;
|
|
|
- var {%H-}ADiff: TCustomVectorialFillDiff);
|
|
|
function ScriptGetAliasing(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptGetArrowEnd(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptGetArrowSize(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptGetArrowStart(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptGetBackColor(AVars: TVariableSet): TScriptResult;
|
|
|
+ function ScriptGetOutlineColor(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptGetBrushCount(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptGetBrushIndex(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptGetBrushSpacing(AVars: TVariableSet): TScriptResult;
|
|
@@ -299,12 +307,18 @@ type
|
|
|
function ScriptGetForeGradientRepetition(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptGetForeGradientType(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptGetForeGradientColors(AVars: TVariableSet): TScriptResult;
|
|
|
+ function ScriptGetOutlineGradientInterpolation(AVars: TVariableSet): TScriptResult;
|
|
|
+ function ScriptGetOutlineGradientRepetition(AVars: TVariableSet): TScriptResult;
|
|
|
+ function ScriptGetOutlineGradientType(AVars: TVariableSet): TScriptResult;
|
|
|
+ function ScriptGetOutlineGradientColors(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptGetTextureRepetition(AVars: TVariableSet; AFill: TVectorialFill): TScriptResult;
|
|
|
function ScriptGetTextureOpacity(AVars: TVariableSet; AFill: TVectorialFill): TScriptResult;
|
|
|
function ScriptGetBackTextureRepetition(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptGetBackTextureOpacity(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptGetForeTextureRepetition(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptGetForeTextureOpacity(AVars: TVariableSet): TScriptResult;
|
|
|
+ function ScriptGetOutlineTextureRepetition(AVars: TVariableSet): TScriptResult;
|
|
|
+ function ScriptGetOutlineTextureOpacity(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptGetJoinStyle(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptGetLightPosition(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptGetLineCap(AVars: TVariableSet): TScriptResult;
|
|
@@ -327,6 +341,7 @@ type
|
|
|
function ScriptSetArrowSize(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptSetArrowStart(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptSetBackColor(AVars: TVariableSet): TScriptResult;
|
|
|
+ function ScriptSetOutlineColor(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptSetBrushIndex(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptSetBrushSpacing(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptSetDeformationGridMode(AVars: TVariableSet): TScriptResult;
|
|
@@ -345,6 +360,10 @@ type
|
|
|
function ScriptSetBackGradientRepetition(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptSetBackGradientType(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptSetBackGradientColors(AVars: TVariableSet): TScriptResult;
|
|
|
+ function ScriptSetOutlineGradientInterpolation(AVars: TVariableSet): TScriptResult;
|
|
|
+ function ScriptSetOutlineGradientRepetition(AVars: TVariableSet): TScriptResult;
|
|
|
+ function ScriptSetOutlineGradientType(AVars: TVariableSet): TScriptResult;
|
|
|
+ function ScriptSetOutlineGradientColors(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptSetForeGradientInterpolation(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptSetForeGradientRepetition(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptSetForeGradientType(AVars: TVariableSet): TScriptResult;
|
|
@@ -358,6 +377,9 @@ type
|
|
|
function ScriptSetForeTexture(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptSetForeTextureRepetition(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptSetForeTextureOpacity(AVars: TVariableSet): TScriptResult;
|
|
|
+ function ScriptSetOutlineTexture(AVars: TVariableSet): TScriptResult;
|
|
|
+ function ScriptSetOutlineTextureRepetition(AVars: TVariableSet): TScriptResult;
|
|
|
+ function ScriptSetOutlineTextureOpacity(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptSetJoinStyle(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptSetLightPosition(AVars: TVariableSet): TScriptResult;
|
|
|
function ScriptSetLineCap(AVars: TVariableSet): TScriptResult;
|
|
@@ -391,6 +413,7 @@ type
|
|
|
procedure SetLightAltitude(AValue: integer);
|
|
|
procedure SetLightPosition(AValue: TPointF);
|
|
|
procedure SetLineCap(AValue: TPenEndCap);
|
|
|
+ procedure SetOutlineColor(AValue: TBGRAPixel);
|
|
|
procedure SetPerspectiveOptions(AValue: TPerspectiveOptions);
|
|
|
procedure SetPhongShapeAltitude(AValue: integer);
|
|
|
procedure SetPhongShapeBorderSize(AValue: integer);
|
|
@@ -420,8 +443,8 @@ type
|
|
|
ShapeControls, PenStyleControls, JoinStyleControls, SplineStyleControls,
|
|
|
CloseShapeControls, LineCapControls, DeformationControls,
|
|
|
TextControls, TextShadowControls, PhongControls, AltitudeControls,
|
|
|
- PerspectiveControls,FillControls,
|
|
|
- BrushControls, RatioControls: TList;
|
|
|
+ PerspectiveControls,FillControls,OutlineFillControls,
|
|
|
+ BrushControls, RatioControls, DonateControls: TList;
|
|
|
|
|
|
constructor Create(AImage: TLazPaintImage; AConfigProvider: IConfigProvider;
|
|
|
ABitmapToVirtualScreen: TBitmapToVirtualScreenFunction = nil;
|
|
@@ -466,9 +489,10 @@ type
|
|
|
function DisplayFilledSelection: boolean;
|
|
|
function IsForeEditGradTexPoints: boolean;
|
|
|
function IsBackEditGradTexPoints: boolean;
|
|
|
+ function IsOutlineEditGradTexPoints: boolean;
|
|
|
procedure QueryExitTool;
|
|
|
|
|
|
- procedure RenderTool(formBitmap: TBGRABitmap);
|
|
|
+ function RenderTool(formBitmap: TBGRABitmap): TRect;
|
|
|
function GetRenderBounds(VirtualScreenWidth, VirtualScreenHeight: integer): TRect;
|
|
|
function SuggestGradientBox: TAffineBox;
|
|
|
|
|
@@ -484,6 +508,7 @@ type
|
|
|
procedure SetDeformationGridSize(ASize: TSize);
|
|
|
|
|
|
property Image: TLazPaintImage read FImage;
|
|
|
+ property Scripting: TScriptContext read FScriptContext;
|
|
|
property BlackAndWhite: boolean read FBlackAndWhite write FBlackAndWhite;
|
|
|
property CurrentTool: TGenericTool read FCurrentTool;
|
|
|
property ToolCurrentCursorPos: TPointF read FToolCurrentCursorPos;
|
|
@@ -494,10 +519,14 @@ type
|
|
|
property AllowedForeFillTypes: TVectorialFillTypes read GetAllowedForeFillTypes;
|
|
|
property BackFill: TVectorialFill read FBackFill;
|
|
|
property AllowedBackFillTypes: TVectorialFillTypes read GetAllowedBackFillTypes;
|
|
|
+ property OutlineFill: TVectorialFill read FOutlineFill;
|
|
|
+ property AllowedOutlineFillTypes: TVectorialFillTypes read GetAllowedOutlineFillTypes;
|
|
|
property ForeColor: TBGRAPixel read GetForeColor write SetForeColor;
|
|
|
property BackColor: TBGRAPixel read GetBackColor write SetBackColor;
|
|
|
+ property OutlineColor: TBGRAPixel read GetOutlineColor write SetOutlineColor;
|
|
|
property ForeLastGradient: TBGRALayerGradientOriginal read FForeLastGradient;
|
|
|
property BackLastGradient: TBGRALayerGradientOriginal read FBackLastGradient;
|
|
|
+ property OutlineLastGradient: TBGRALayerGradientOriginal read FOutlineLastGradient;
|
|
|
property EraserMode: TEraserMode read FEraserMode write SetEraserMode;
|
|
|
property EraserAlpha: byte read FEraserAlpha write SetEraserAlpha;
|
|
|
property PenWidth: single read GetPenWidth write SetPenWidth;
|
|
@@ -541,6 +570,7 @@ type
|
|
|
property PerspectiveOptions: TPerspectiveOptions read FPerspectiveOptions write SetPerspectiveOptions;
|
|
|
|
|
|
property OnToolChanged: TOnToolChangedHandler read FOnToolChangedHandler write FOnToolChangedHandler;
|
|
|
+ property OnToolRenderChanged: TNotifyEvent read FOnToolRenderChanged write FOnToolRenderChanged;
|
|
|
property OnToolbarChanged: TNotifyEvent read FOnToolbarChanged write FOnToolbarChanged;
|
|
|
property OnPopup: TOnPopupToolHandler read FOnPopupToolHandler write FOnPopupToolHandler;
|
|
|
property OnEraserChanged: TNotifyEvent read FOnEraserChanged write FOnEraserChanged;
|
|
@@ -573,7 +603,7 @@ function ToolPopupMessageToStr(AMessage :TToolPopupMessage; AKey: Word = 0): str
|
|
|
implementation
|
|
|
|
|
|
uses UGraph, LCScaleDPI, LazPaintType, UCursors, BGRATextFX, ULoading, UResourceStrings,
|
|
|
- BGRATransform, LCVectorOriginal, BGRASVGOriginal, math, ULoadImage;
|
|
|
+ BGRATransform, LCVectorOriginal, BGRASVGOriginal, math, ULoadImage, LCVectorTextShapes;
|
|
|
|
|
|
function StrToPaintToolType(const s: ansistring): TPaintToolType;
|
|
|
var pt: TPaintToolType;
|
|
@@ -792,11 +822,21 @@ begin
|
|
|
result := [vftSolid,vftGradient,vftTexture];
|
|
|
end;
|
|
|
|
|
|
+function TGenericTool.GetAllowedOutlineFillTypes: TVectorialFillTypes;
|
|
|
+begin
|
|
|
+ result := [vftSolid,vftGradient,vftTexture];
|
|
|
+end;
|
|
|
+
|
|
|
function TGenericTool.GetIsBackEditGradTexPoints: boolean;
|
|
|
begin
|
|
|
result := false;
|
|
|
end;
|
|
|
|
|
|
+function TGenericTool.GetIsOutlineEditGradTexPoints: boolean;
|
|
|
+begin
|
|
|
+ result := false;
|
|
|
+end;
|
|
|
+
|
|
|
function TGenericTool.GetIsForeEditGradTexPoints: boolean;
|
|
|
begin
|
|
|
result := false;
|
|
@@ -1075,63 +1115,45 @@ function TGenericTool.ToolKeyDown(var key: Word): TRect;
|
|
|
var
|
|
|
key2: Word;
|
|
|
begin
|
|
|
- if (Key = VK_SNAP) or (Key = VK_SNAP2) then
|
|
|
- begin
|
|
|
- key2 := VK_CONTROL;
|
|
|
- result := DoToolKeyDown(key2);
|
|
|
- if key2 = 0 then key := 0;
|
|
|
- end else
|
|
|
- result := DoToolKeyDown(key);
|
|
|
-
|
|
|
if key = VK_SHIFT then
|
|
|
begin
|
|
|
Include(FShiftState, ssShift);
|
|
|
- key := 0;
|
|
|
+ //do not reset Key to preserve typing ^o or "o
|
|
|
end else
|
|
|
+ if (key = VK_MENU) then
|
|
|
+ Include(FShiftState, ssAlt);
|
|
|
+
|
|
|
if (Key = VK_SNAP) or (Key = VK_SNAP2) then
|
|
|
begin
|
|
|
+ key2 := VK_CONTROL;
|
|
|
Include(FShiftState, ssSnap);
|
|
|
- key := 0;
|
|
|
+ result := DoToolKeyDown(key2);
|
|
|
+ if key2 = 0 then key := 0;
|
|
|
end else
|
|
|
- if (key = VK_MENU) then
|
|
|
- begin
|
|
|
- Include(FShiftState, ssAlt);
|
|
|
- key := 0;
|
|
|
- end;
|
|
|
+ result := DoToolKeyDown(key);
|
|
|
end;
|
|
|
|
|
|
function TGenericTool.ToolKeyUp(var key: Word): TRect;
|
|
|
var
|
|
|
- handled: Boolean;
|
|
|
key2: word;
|
|
|
begin
|
|
|
if (key = VK_SHIFT) and (ssShift in FShiftState) then
|
|
|
begin
|
|
|
Exclude(FShiftState, ssShift);
|
|
|
- handled := true;
|
|
|
- end else
|
|
|
- if ((key = VK_SNAP) or (key = VK_SNAP2)) and (ssSnap in FShiftState) then
|
|
|
- begin
|
|
|
- Exclude(FShiftState, ssSnap);
|
|
|
- handled := true;
|
|
|
+ //do not reset key to preserve typing ^o or "o
|
|
|
end else
|
|
|
if (key = VK_MENU) and (ssAlt in FShiftState) then
|
|
|
- begin
|
|
|
Exclude(FShiftState, ssAlt);
|
|
|
- handled := true;
|
|
|
- end else
|
|
|
- handled := false;
|
|
|
|
|
|
//propagate in all cases to know when keys are released for unicode input
|
|
|
if (Key = VK_SNAP) or (Key = VK_SNAP2) then
|
|
|
begin
|
|
|
key2 := VK_CONTROL;
|
|
|
+ Exclude(FShiftState, ssSnap);
|
|
|
result := DoToolKeyUp(key2);
|
|
|
if key2 = 0 then key := 0;
|
|
|
end else
|
|
|
result := DoToolKeyUp(key);
|
|
|
-
|
|
|
- if handled then key := 0;
|
|
|
end;
|
|
|
|
|
|
function TGenericTool.ToolKeyPress(var key: TUTF8Char): TRect;
|
|
@@ -1365,6 +1387,11 @@ begin
|
|
|
if Assigned(FOnLineCapChanged) then FOnLineCapChanged(self);
|
|
|
end;
|
|
|
|
|
|
+procedure TToolManager.SetOutlineColor(AValue: TBGRAPixel);
|
|
|
+begin
|
|
|
+ FOutlineFill.SolidColor := AValue;
|
|
|
+end;
|
|
|
+
|
|
|
procedure TToolManager.SetPerspectiveOptions(AValue: TPerspectiveOptions);
|
|
|
begin
|
|
|
if FPerspectiveOptions=AValue then Exit;
|
|
@@ -1611,16 +1638,26 @@ begin
|
|
|
if toolCursor <> crDefault then result := toolCursor;
|
|
|
end;
|
|
|
|
|
|
-procedure TToolManager.BackFillChange(ASender: TObject;
|
|
|
+procedure TToolManager.FillChange(ASender: TObject;
|
|
|
var ADiff: TCustomVectorialFillDiff);
|
|
|
begin
|
|
|
if FInToolUpdate or FInSwapFill then exit;
|
|
|
ToolUpdate;
|
|
|
if Assigned(FOnFillChanged) then FOnFillChanged(self);
|
|
|
- if FBackFill.FillType = vftGradient then
|
|
|
+ if (ASender = FBackFill) and (FBackFill.FillType = vftGradient) then
|
|
|
begin
|
|
|
FBackLastGradient.Free;
|
|
|
FBackLastGradient := FBackFill.Gradient.Duplicate as TBGRALayerGradientOriginal;
|
|
|
+ end else
|
|
|
+ if (ASender = FForeFill) and (FForeFill.FillType = vftGradient) then
|
|
|
+ begin
|
|
|
+ FForeLastGradient.Free;
|
|
|
+ FForeLastGradient := FForeFill.Gradient.Duplicate as TBGRALayerGradientOriginal;
|
|
|
+ end else
|
|
|
+ if (ASender = FOutlineFill) and (FOutlineFill.FillType = vftGradient) then
|
|
|
+ begin
|
|
|
+ FOutlineLastGradient.Free;
|
|
|
+ FOutlineLastGradient := FOutlineFill.Gradient.Duplicate as TBGRALayerGradientOriginal;
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -1636,6 +1673,12 @@ begin
|
|
|
else result := [vftSolid,vftGradient,vftTexture];
|
|
|
end;
|
|
|
|
|
|
+function TToolManager.GetAllowedOutlineFillTypes: TVectorialFillTypes;
|
|
|
+begin
|
|
|
+ if Assigned(CurrentTool) then result := CurrentTool.AllowedOutlineFillTypes
|
|
|
+ else result := [vftSolid,vftGradient,vftTexture];
|
|
|
+end;
|
|
|
+
|
|
|
function TToolManager.GetForeColor: TBGRAPixel;
|
|
|
begin
|
|
|
if BlackAndWhite then
|
|
@@ -1650,6 +1693,14 @@ begin
|
|
|
result.cy := Max(MinDeformationGridSize,Min(image.Height div 2,50)+1);
|
|
|
end;
|
|
|
|
|
|
+function TToolManager.GetOutlineColor: TBGRAPixel;
|
|
|
+begin
|
|
|
+ if BlackAndWhite then
|
|
|
+ result := BGRAToGrayscale(FOutlineFill.AverageColor)
|
|
|
+ else
|
|
|
+ result := FOutlineFill.AverageColor;
|
|
|
+end;
|
|
|
+
|
|
|
function TToolManager.GetShapeOptionAliasing: boolean;
|
|
|
begin
|
|
|
result := toAliasing in FShapeOptions;
|
|
@@ -1681,19 +1732,6 @@ begin
|
|
|
result := FTextFontStyle;
|
|
|
end;
|
|
|
|
|
|
-procedure TToolManager.ForeFillChange(ASender: TObject;
|
|
|
- var ADiff: TCustomVectorialFillDiff);
|
|
|
-begin
|
|
|
- if FInToolUpdate or FInSwapFill then exit;
|
|
|
- ToolUpdate;
|
|
|
- if Assigned(FOnFillChanged) then FOnFillChanged(self);
|
|
|
- if FForeFill.FillType = vftGradient then
|
|
|
- begin
|
|
|
- FForeLastGradient.Free;
|
|
|
- FForeLastGradient := FForeFill.Gradient.Duplicate as TBGRALayerGradientOriginal;
|
|
|
- end;
|
|
|
-end;
|
|
|
-
|
|
|
function TToolManager.ScriptGetAliasing(AVars: TVariableSet): TScriptResult;
|
|
|
begin
|
|
|
AVars.Booleans['Result'] := toAliasing in ShapeOptions;
|
|
@@ -1724,6 +1762,12 @@ begin
|
|
|
result := srOk;
|
|
|
end;
|
|
|
|
|
|
+function TToolManager.ScriptGetOutlineColor(AVars: TVariableSet): TScriptResult;
|
|
|
+begin
|
|
|
+ AVars.Pixels['Result'] := OutlineColor;
|
|
|
+ result := srOk;
|
|
|
+end;
|
|
|
+
|
|
|
function TToolManager.ScriptGetBrushCount(AVars: TVariableSet): TScriptResult;
|
|
|
begin
|
|
|
AVars.Integers['Result'] := BrushCount;
|
|
@@ -1897,6 +1941,26 @@ begin
|
|
|
result := ScriptGetGradientColors(AVars, FForeFill);
|
|
|
end;
|
|
|
|
|
|
+function TToolManager.ScriptGetOutlineGradientInterpolation(AVars: TVariableSet): TScriptResult;
|
|
|
+begin
|
|
|
+ result := ScriptGetGradientInterpolation(AVars, FOutlineFill);
|
|
|
+end;
|
|
|
+
|
|
|
+function TToolManager.ScriptGetOutlineGradientRepetition(AVars: TVariableSet): TScriptResult;
|
|
|
+begin
|
|
|
+ result := ScriptGetGradientRepetition(AVars, FOutlineFill);
|
|
|
+end;
|
|
|
+
|
|
|
+function TToolManager.ScriptGetOutlineGradientType(AVars: TVariableSet): TScriptResult;
|
|
|
+begin
|
|
|
+ result := ScriptGetGradientType(AVars, FOutlineFill);
|
|
|
+end;
|
|
|
+
|
|
|
+function TToolManager.ScriptGetOutlineGradientColors(AVars: TVariableSet): TScriptResult;
|
|
|
+begin
|
|
|
+ result := ScriptGetGradientColors(AVars, FOutlineFill);
|
|
|
+end;
|
|
|
+
|
|
|
function TToolManager.ScriptGetTextureRepetition(AVars: TVariableSet;
|
|
|
AFill: TVectorialFill): TScriptResult;
|
|
|
begin
|
|
@@ -1940,6 +2004,16 @@ begin
|
|
|
result := ScriptGetTextureOpacity(AVars, ForeFill);
|
|
|
end;
|
|
|
|
|
|
+function TToolManager.ScriptGetOutlineTextureRepetition(AVars: TVariableSet): TScriptResult;
|
|
|
+begin
|
|
|
+ result := ScriptGetTextureRepetition(AVars, OutlineFill);
|
|
|
+end;
|
|
|
+
|
|
|
+function TToolManager.ScriptGetOutlineTextureOpacity(AVars: TVariableSet): TScriptResult;
|
|
|
+begin
|
|
|
+ result := ScriptGetTextureOpacity(AVars, OutlineFill);
|
|
|
+end;
|
|
|
+
|
|
|
function TToolManager.ScriptGetJoinStyle(AVars: TVariableSet): TScriptResult;
|
|
|
begin
|
|
|
result := srOk;
|
|
@@ -2158,6 +2232,12 @@ begin
|
|
|
result := srOk;
|
|
|
end;
|
|
|
|
|
|
+function TToolManager.ScriptSetOutlineColor(AVars: TVariableSet): TScriptResult;
|
|
|
+begin
|
|
|
+ OutlineColor := AVars.Pixels['Color'];
|
|
|
+ result := srOk;
|
|
|
+end;
|
|
|
+
|
|
|
function TToolManager.ScriptSetBrushIndex(AVars: TVariableSet): TScriptResult;
|
|
|
var
|
|
|
index: Int64;
|
|
@@ -2310,8 +2390,8 @@ begin
|
|
|
AFill.Gradient.GradientType:= gt
|
|
|
else
|
|
|
begin
|
|
|
- if AFill = BackFill then
|
|
|
- lastGrad := FBackLastGradient
|
|
|
+ if AFill = BackFill then lastGrad := FBackLastGradient
|
|
|
+ else if AFill = OutlineFill then lastGrad := FOutlineLastGradient
|
|
|
else lastGrad := FForeLastGradient;
|
|
|
|
|
|
lastGrad.GradientType:= gt;
|
|
@@ -2343,8 +2423,8 @@ begin
|
|
|
AFill.Gradient.SetColors(TVariableSet.GetPixelAt(colors, 0), TVariableSet.GetPixelAt(colors, 1))
|
|
|
else
|
|
|
begin
|
|
|
- if AFill = BackFill then
|
|
|
- lastGrad := FBackLastGradient
|
|
|
+ if AFill = BackFill then lastGrad := FBackLastGradient
|
|
|
+ else if AFill = OutlineFill then lastGrad := FOutlineLastGradient
|
|
|
else lastGrad := FForeLastGradient;
|
|
|
|
|
|
b := SuggestGradientBox;
|
|
@@ -2380,6 +2460,26 @@ begin
|
|
|
result := ScriptSetGradientColors(AVars, FBackFill);
|
|
|
end;
|
|
|
|
|
|
+function TToolManager.ScriptSetOutlineGradientInterpolation(AVars: TVariableSet): TScriptResult;
|
|
|
+begin
|
|
|
+ result := ScriptSetGradientInterpolation(AVars, FOutlineFill);
|
|
|
+end;
|
|
|
+
|
|
|
+function TToolManager.ScriptSetOutlineGradientRepetition(AVars: TVariableSet): TScriptResult;
|
|
|
+begin
|
|
|
+ result := ScriptSetGradientRepetition(AVars, FOutlineFill);
|
|
|
+end;
|
|
|
+
|
|
|
+function TToolManager.ScriptSetOutlineGradientType(AVars: TVariableSet): TScriptResult;
|
|
|
+begin
|
|
|
+ result := ScriptSetGradientType(AVars, FOutlineFill);
|
|
|
+end;
|
|
|
+
|
|
|
+function TToolManager.ScriptSetOutlineGradientColors(AVars: TVariableSet): TScriptResult;
|
|
|
+begin
|
|
|
+ result := ScriptSetGradientColors(AVars, FOutlineFill);
|
|
|
+end;
|
|
|
+
|
|
|
function TToolManager.ScriptSetForeGradientInterpolation(AVars: TVariableSet): TScriptResult;
|
|
|
begin
|
|
|
result := ScriptSetGradientInterpolation(AVars, FForeFill);
|
|
@@ -2473,6 +2573,21 @@ begin
|
|
|
result := ScriptSetTextureOpacity(AVars, ForeFill);
|
|
|
end;
|
|
|
|
|
|
+function TToolManager.ScriptSetOutlineTexture(AVars: TVariableSet): TScriptResult;
|
|
|
+begin
|
|
|
+ result := ScriptSetTexture(AVars, OutlineFill);
|
|
|
+end;
|
|
|
+
|
|
|
+function TToolManager.ScriptSetOutlineTextureRepetition(AVars: TVariableSet): TScriptResult;
|
|
|
+begin
|
|
|
+ result := ScriptSetTextureRepetition(AVars, OutlineFill);
|
|
|
+end;
|
|
|
+
|
|
|
+function TToolManager.ScriptSetOutlineTextureOpacity(AVars: TVariableSet): TScriptResult;
|
|
|
+begin
|
|
|
+ result := ScriptSetTextureOpacity(AVars, OutlineFill);
|
|
|
+end;
|
|
|
+
|
|
|
function TToolManager.ScriptSetJoinStyle(AVars: TVariableSet): TScriptResult;
|
|
|
begin
|
|
|
result := srOk;
|
|
@@ -2711,15 +2826,26 @@ begin
|
|
|
RegisterScriptFunctions(True);
|
|
|
|
|
|
FForeFill := TVectorialFill.Create;
|
|
|
+ FForeFill.TransparentMode := tmAlphaZeroOnly;
|
|
|
FForeFill.SolidColor := BGRABlack;
|
|
|
- FForeFill.OnChange:=@ForeFillChange;
|
|
|
- FBackFill := TVectorialFill.Create;
|
|
|
- FBackFill.SolidColor := CSSSkyBlue;
|
|
|
- FBackFill.OnChange:=@BackFillChange;
|
|
|
+ FForeFill.OnChange:= @FillChange;
|
|
|
FForeLastGradient:= TBGRALayerGradientOriginal.Create;
|
|
|
FForeLastGradient.ColorInterpolation:= ciLinearRGB;
|
|
|
+
|
|
|
+ FBackFill := TVectorialFill.Create;
|
|
|
+ FBackFill.TransparentMode := tmAlphaZeroOnly;
|
|
|
+ FBackFill.SolidColor := CSSSkyBlue;
|
|
|
+ FBackFill.OnChange:= @FillChange;
|
|
|
FBackLastGradient:= TBGRALayerGradientOriginal.Create;
|
|
|
FBackLastGradient.ColorInterpolation:= ciLinearRGB;
|
|
|
+
|
|
|
+ FOutlineFill := TVectorialFill.Create;
|
|
|
+ FOutlineFill.TransparentMode := tmAlphaZeroOnly;
|
|
|
+ FOutlineFill.SolidColor := CSSRed;
|
|
|
+ FOutlineFill.OnChange:= @FillChange;
|
|
|
+ FOutlineLastGradient:= TBGRALayerGradientOriginal.Create;
|
|
|
+ FOutlineLastGradient.ColorInterpolation:= ciLinearRGB;
|
|
|
+
|
|
|
FNormalPenWidth := 5;
|
|
|
FEraserWidth := 10;
|
|
|
FEraserAlpha := 255;
|
|
@@ -2740,7 +2866,7 @@ begin
|
|
|
FTextOutlineWidth := 2;
|
|
|
FTextShadow := false;
|
|
|
FTextFontSize := 10;
|
|
|
- FTextFontName := 'Arial';
|
|
|
+ FTextFontName := TTextShape.DefaultFontName;
|
|
|
FTextFontStyle:= [];
|
|
|
FTextAlign := taLeftJustify;
|
|
|
FTextPhong := False;
|
|
@@ -2773,8 +2899,10 @@ begin
|
|
|
AltitudeControls := TList.Create;
|
|
|
PerspectiveControls := TList.Create;
|
|
|
FillControls := TList.Create;
|
|
|
+ OutlineFillControls := TList.Create;
|
|
|
BrushControls := TList.Create;
|
|
|
RatioControls := TList.Create;
|
|
|
+ DonateControls := TList.Create;
|
|
|
|
|
|
FCurrentToolType := ptHand;
|
|
|
FCurrentTool := PaintTools[ptHand].Create(Self);
|
|
@@ -2804,8 +2932,10 @@ begin
|
|
|
AltitudeControls.Free;
|
|
|
PerspectiveControls.Free;
|
|
|
FillControls.Free;
|
|
|
+ OutlineFillControls.Free;
|
|
|
BrushControls.Free;
|
|
|
RatioControls.Free;
|
|
|
+ DonateControls.Free;
|
|
|
|
|
|
for i := 0 to BrushCount do
|
|
|
BrushAt[i].Free;
|
|
@@ -2813,8 +2943,10 @@ begin
|
|
|
|
|
|
FForeFill.Free;
|
|
|
FBackFill.Free;
|
|
|
+ FOutlineFill.Free;
|
|
|
FForeLastGradient.Free;
|
|
|
FBackLastGradient.Free;
|
|
|
+ FOutlineLastGradient.Free;
|
|
|
|
|
|
RegisterScriptFunctions(False);
|
|
|
inherited Destroy;
|
|
@@ -2831,8 +2963,10 @@ begin
|
|
|
exit;
|
|
|
ForeColor := Config.DefaultToolForeColor;
|
|
|
BackColor := Config.DefaultToolBackColor;
|
|
|
+ OutlineColor := Config.DefaultToolOutlineColor;
|
|
|
AssignGradientFromConfigStr(FForeLastGradient, Config.DefaultToolForeGradient);
|
|
|
AssignGradientFromConfigStr(FBackLastGradient, Config.DefaultToolBackGradient);
|
|
|
+ AssignGradientFromConfigStr(FOutlineLastGradient, Config.DefaultToolOutlineGradient);
|
|
|
FNormalPenWidth := Config.DefaultToolPenWidth;
|
|
|
FEraserWidth := Config.DefaultToolEraserWidth;
|
|
|
if Assigned(FOnPenWidthChanged) then FOnPenWidthChanged(self);
|
|
@@ -2869,8 +3003,10 @@ begin
|
|
|
exit;
|
|
|
if ForeFill.FillType = vftSolid then Config.SetDefaultToolForeColor(ForeColor);
|
|
|
if BackFill.FillType = vftSolid then Config.SetDefaultToolBackColor(BackColor);
|
|
|
+ if OutlineFill.FillType = vftSolid then Config.SetDefaultToolOutlineColor(OutlineColor);
|
|
|
Config.SetDefaultToolForeGradient(GradientToConfigStr(FForeLastGradient));
|
|
|
Config.SetDefaultToolBackGradient(GradientToConfigStr(FBackLastGradient));
|
|
|
+ Config.SetDefaultToolOutlineGradient(GradientToConfigStr(FOutlineLastGradient));
|
|
|
Config.SetDefaultToolPenWidth(FNormalPenWidth);
|
|
|
Config.SetDefaultToolEraserWidth(FEraserWidth);
|
|
|
Config.SetDefaultToolOptionDrawShape(toDrawShape in ShapeOptions);
|
|
@@ -2995,11 +3131,11 @@ begin
|
|
|
if not IsSelectingTool then
|
|
|
Image.ReleaseEmptySelection;
|
|
|
|
|
|
- Image.RenderMayChange(rect(0,0,Image.Width,Image.Height),True);
|
|
|
-
|
|
|
UpdateContextualToolbars;
|
|
|
If Assigned(FOnToolChangedHandler) then
|
|
|
FOnToolChangedHandler(self, FCurrentToolType);
|
|
|
+ If Assigned(FOnToolRenderChanged) then
|
|
|
+ FOnToolRenderChanged(self);
|
|
|
end;
|
|
|
FShouldExitTool:= false;
|
|
|
end;
|
|
@@ -3046,12 +3182,19 @@ begin
|
|
|
OrResult(SetControlsVisible(EraserControls, ctEraserOption in contextualToolbars));
|
|
|
OrResult(SetControlsVisible(ToleranceControls, ctTolerance in contextualToolbars));
|
|
|
OrResult(SetControlsVisible(DeformationControls, ctDeformation in contextualToolbars));
|
|
|
- OrResult(SetControlsVisible(TextControls, ctText in contextualToolbars));
|
|
|
+ if (ctText in contextualToolbars) and not (ctOutlineWidth in contextualToolbars) then
|
|
|
+ OrResult(SetControlsVisible(TextControls, True, 'Panel_Text')) else
|
|
|
+ if (ctOutlineWidth in contextualToolbars) and not (ctText in contextualToolbars) then
|
|
|
+ OrResult(SetControlsVisible(TextControls, True, 'Panel_TextOutline'))
|
|
|
+ else
|
|
|
+ OrResult(SetControlsVisible(TextControls, (ctText in contextualToolbars) and (ctOutlineWidth in contextualToolbars)));
|
|
|
+ OrResult(SetControlsVisible(OutlineFillControls, ctOutlineFill in contextualToolbars));
|
|
|
OrResult(SetControlsVisible(TextShadowControls, ctTextShadow in contextualToolbars));
|
|
|
OrResult(SetControlsVisible(PhongControls, ctPhong in contextualToolbars));
|
|
|
OrResult(SetControlsVisible(AltitudeControls, ctAltitude in contextualToolbars));
|
|
|
OrResult(SetControlsVisible(PerspectiveControls, ctPerspective in contextualToolbars));
|
|
|
OrResult(SetControlsVisible(RatioControls, ctRatio in contextualToolbars));
|
|
|
+ OrResult(SetControlsVisible(DonateControls, FCurrentToolType = ptHand));
|
|
|
|
|
|
if result and Assigned(FOnToolbarChanged) then FOnToolbarChanged(self);
|
|
|
end;
|
|
@@ -3084,6 +3227,8 @@ begin
|
|
|
FScriptContext.RegisterScriptFunction('ToolGetForeColor', @ScriptGetForeColor, ARegister);
|
|
|
FScriptContext.RegisterScriptFunction('ToolSetBackColor', @ScriptSetBackColor, ARegister);
|
|
|
FScriptContext.RegisterScriptFunction('ToolGetBackColor', @ScriptGetBackColor, ARegister);
|
|
|
+ FScriptContext.RegisterScriptFunction('ToolSetOutlineColor', @ScriptSetOutlineColor, ARegister);
|
|
|
+ FScriptContext.RegisterScriptFunction('ToolGetOutlineColor', @ScriptGetOutlineColor, ARegister);
|
|
|
FScriptContext.RegisterScriptFunction('ToolSetEraserMode', @ScriptSetEraserMode, ARegister);
|
|
|
FScriptContext.RegisterScriptFunction('ToolGetEraserMode', @ScriptGetEraserMode, ARegister);
|
|
|
FScriptContext.RegisterScriptFunction('ToolSetEraserAlpha', @ScriptSetEraserAlpha, ARegister);
|
|
@@ -3147,6 +3292,14 @@ begin
|
|
|
FScriptContext.RegisterScriptFunction('ToolGetBackGradientInterpolation', @ScriptGetBackGradientInterpolation, ARegister);
|
|
|
FScriptContext.RegisterScriptFunction('ToolSetBackGradientColors', @ScriptSetBackGradientColors, ARegister);
|
|
|
FScriptContext.RegisterScriptFunction('ToolGetBackGradientColors', @ScriptGetBackGradientColors, ARegister);
|
|
|
+ FScriptContext.RegisterScriptFunction('ToolSetOutlineGradientType', @ScriptSetOutlineGradientType, ARegister);
|
|
|
+ FScriptContext.RegisterScriptFunction('ToolGetOutlineGradientType', @ScriptGetOutlineGradientType, ARegister);
|
|
|
+ FScriptContext.RegisterScriptFunction('ToolSetOutlineGradientRepetition', @ScriptSetOutlineGradientRepetition, ARegister);
|
|
|
+ FScriptContext.RegisterScriptFunction('ToolGetOutlineGradientRepetition', @ScriptGetOutlineGradientRepetition, ARegister);
|
|
|
+ FScriptContext.RegisterScriptFunction('ToolSetOutlineGradientInterpolation', @ScriptSetOutlineGradientInterpolation, ARegister);
|
|
|
+ FScriptContext.RegisterScriptFunction('ToolGetOutlineGradientInterpolation', @ScriptGetOutlineGradientInterpolation, ARegister);
|
|
|
+ FScriptContext.RegisterScriptFunction('ToolSetOutlineGradientColors', @ScriptSetOutlineGradientColors, ARegister);
|
|
|
+ FScriptContext.RegisterScriptFunction('ToolGetOutlineGradientColors', @ScriptGetOutlineGradientColors, ARegister);
|
|
|
FScriptContext.RegisterScriptFunction('ToolSetForeTexture', @ScriptSetForeTexture, ARegister);
|
|
|
FScriptContext.RegisterScriptFunction('ToolSetForeTextureRepetition', @ScriptSetForeTextureRepetition, ARegister);
|
|
|
FScriptContext.RegisterScriptFunction('ToolGetForeTextureRepetition', @ScriptGetForeTextureRepetition, ARegister);
|
|
@@ -3157,6 +3310,11 @@ begin
|
|
|
FScriptContext.RegisterScriptFunction('ToolGetBackTextureRepetition', @ScriptGetBackTextureRepetition, ARegister);
|
|
|
FScriptContext.RegisterScriptFunction('ToolSetBackTextureOpacity', @ScriptSetBackTextureOpacity, ARegister);
|
|
|
FScriptContext.RegisterScriptFunction('ToolGetBackTextureOpacity', @ScriptGetBackTextureOpacity, ARegister);
|
|
|
+ FScriptContext.RegisterScriptFunction('ToolSetOutlineTexture', @ScriptSetOutlineTexture, ARegister);
|
|
|
+ FScriptContext.RegisterScriptFunction('ToolSetOutlineTextureRepetition', @ScriptSetOutlineTextureRepetition, ARegister);
|
|
|
+ FScriptContext.RegisterScriptFunction('ToolGetOutlineTextureRepetition', @ScriptGetOutlineTextureRepetition, ARegister);
|
|
|
+ FScriptContext.RegisterScriptFunction('ToolSetOutlineTextureOpacity', @ScriptSetOutlineTextureOpacity, ARegister);
|
|
|
+ FScriptContext.RegisterScriptFunction('ToolGetOutlineTextureOpacity', @ScriptGetOutlineTextureOpacity, ARegister);
|
|
|
FScriptContext.RegisterScriptFunction('ToolSetPhongShapeAltitude', @ScriptSetPhongShapeAltitude, ARegister);
|
|
|
FScriptContext.RegisterScriptFunction('ToolGetPhongShapeAltitude', @ScriptGetPhongShapeAltitude, ARegister);
|
|
|
FScriptContext.RegisterScriptFunction('ToolSetPhongShapeBorderSize', @ScriptSetPhongShapeBorderSize, ARegister);
|
|
@@ -3183,10 +3341,11 @@ begin
|
|
|
FCurrentTool := FSleepingTool;
|
|
|
FSleepingTool := nil;
|
|
|
FCurrentToolType := FSleepingToolType;
|
|
|
- Image.RenderMayChange(rect(0,0,Image.Width,Image.Height),True);
|
|
|
UpdateContextualToolbars;
|
|
|
If Assigned(FOnToolChangedHandler) then
|
|
|
FOnToolChangedHandler(self, FCurrentToolType);
|
|
|
+ If Assigned(FOnToolRenderChanged) then
|
|
|
+ FOnToolRenderChanged(self);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -3301,6 +3460,7 @@ end;
|
|
|
procedure TToolManager.SetTextFont(AName: string; ASize: single;
|
|
|
AStyle: TFontStyles);
|
|
|
begin
|
|
|
+ if AName = '' then AName := FTextFontName;
|
|
|
if (FTextFontName <> AName) or
|
|
|
(FTextFontSize <> ASize) or
|
|
|
(FTextFontStyle <> AStyle) then
|
|
@@ -3510,6 +3670,9 @@ begin
|
|
|
FInTool := true;
|
|
|
try
|
|
|
FCurrentTool := PaintTools[FCurrentToolType].Create(self);
|
|
|
+ UpdateContextualToolbars;
|
|
|
+ If Assigned(FOnToolRenderChanged) then
|
|
|
+ FOnToolRenderChanged(self);
|
|
|
finally
|
|
|
FInTool := false;
|
|
|
end;
|
|
@@ -3579,22 +3742,29 @@ begin
|
|
|
else result := false;
|
|
|
end;
|
|
|
|
|
|
+function TToolManager.IsOutlineEditGradTexPoints: boolean;
|
|
|
+begin
|
|
|
+ if Assigned(CurrentTool) then result := CurrentTool.IsOutlineEditGradTexPoints
|
|
|
+ else result := false;
|
|
|
+end;
|
|
|
+
|
|
|
procedure TToolManager.QueryExitTool;
|
|
|
begin
|
|
|
FShouldExitTool:= true;
|
|
|
end;
|
|
|
|
|
|
-procedure TToolManager.RenderTool(formBitmap: TBGRABitmap);
|
|
|
+function TToolManager.RenderTool(formBitmap: TBGRABitmap): TRect;
|
|
|
begin
|
|
|
if ToolCanBeUsed and Assigned(CurrentTool) and not FInTool then
|
|
|
begin
|
|
|
FInTool := true;
|
|
|
try
|
|
|
- Image.RenderMayChange(CurrentTool.Render(formBitmap,formBitmap.Width,formBitmap.Height, @InternalBitmapToVirtualScreen));
|
|
|
+ result := CurrentTool.Render(formBitmap,formBitmap.Width,formBitmap.Height, @InternalBitmapToVirtualScreen);
|
|
|
finally
|
|
|
FInTool := false;
|
|
|
end;
|
|
|
- end;
|
|
|
+ end else
|
|
|
+ result := EmptyRect;
|
|
|
end;
|
|
|
|
|
|
function TToolManager.GetRenderBounds(VirtualScreenWidth, VirtualScreenHeight: integer): TRect;
|