|
@@ -43,6 +43,7 @@ type
|
|
|
procedure UpdateUserMode; virtual;
|
|
|
procedure ShapeValidated; override;
|
|
|
function DoToolKeyDown(var key: Word): TRect; override;
|
|
|
+ function RoundCoordinate(ptF: TPointF): TPointF; override;
|
|
|
public
|
|
|
function ToolUp: TRect; override;
|
|
|
function ToolKeyPress(var key: TUTF8Char): TRect; override;
|
|
@@ -357,6 +358,14 @@ begin
|
|
|
Result:=inherited DoToolKeyDown(key);
|
|
|
end;
|
|
|
|
|
|
+function TToolPolygon.RoundCoordinate(ptF: TPointF): TPointF;
|
|
|
+begin
|
|
|
+ If Editor.GridActive then
|
|
|
+ result := Editor.SnapToGrid(ptF, false)
|
|
|
+ else
|
|
|
+ result := ptF;
|
|
|
+end;
|
|
|
+
|
|
|
function TToolPolygon.GetContextualToolbars: TContextualToolbars;
|
|
|
begin
|
|
|
Result:= [ctFill,ctShape,ctCloseShape,ctPenWidth,ctPenStyle,ctJoinStyle,ctLineCap];
|