Browse Source

#335 more consistent hints, restart timer, validated poly point count

circular17 3 years ago
parent
commit
ba697c792a

+ 9 - 1
lazpaint/lazpaintmainform.pas

@@ -15,7 +15,8 @@ uses
 
   LazPaintType, UMainFormLayout, UTool, UImage, UImageAction, UZoom,
   UImageObservation, UConfig, LCScaleDPI, UResourceStrings, UMenu, uscripting,
-  ubrowseimages, UToolPolygon, UToolVectorial, LCVectorRectShapes,
+  ubrowseimages, UToolPolygon, UToolVectorial, UToolDeformationGrid, UToolSelect,
+  UToolBasic, UToolBrush, LCVectorRectShapes,
   LCVectorialFillControl, LCVectorialFill,
 
   udarktheme, UScriptType;
@@ -3668,6 +3669,13 @@ begin
   Config.SetDefaultRetrieveSelectionAnswer(0);
   for m := low(TToolPopupMessage) to high(TToolPopupMessage) do
     Config.SetToolPopupMessageShownCount(ord(m), 0);
+  UToolPolygon.TToolPolygon.ForgetHintShown;
+  UToolVectorial.TVectorialTool.ForgetHintShown;
+  UToolDeformationGrid.TToolTextureMapping.ForgetHintShown;
+  UToolDeformationGrid.TToolDeformationGrid.ForgetHintShown;
+  UToolSelect.TToolRotateSelection.ForgetHintShown;
+  UToolBasic.TToolPen.ForgetHintShown;
+  UToolBrush.TToolBrush.ForgetHintShown;
 end;
 
 procedure TFMain.FormClose(Sender: TObject; var CloseAction: TCloseAction);

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.ar.po

@@ -3616,6 +3616,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgstr "RGB"
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgstr ""

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.bg.po

@@ -3600,6 +3600,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgstr "ЧЗС"
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgstr "Укажете източника с ДЕСЕН цък"

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.cs.po

@@ -3635,6 +3635,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgstr "RGB"
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgstr "Použijte PRAVÝ klik k určení zdroje"

+ 5 - 1
lazpaint/release/bin/i18n/lazpaint.de.po

@@ -3445,7 +3445,7 @@ msgstr "Neues Bild"
 
 #: uresourcestrings.rsnewmask
 msgid "New mask"
-msgstr "Neue Maske"                         "
+msgstr "Neue Maske\"                         "
 
 #: uresourcestrings.rsno
 msgid "No"
@@ -3627,6 +3627,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgstr "RGB"
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgstr "RECHTS-Klick um die Quelle zu wählen"

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.es.po

@@ -3639,6 +3639,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgstr "RGB"
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr "Usa clic DERECHO para acabar la forma"
+
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgstr "Usa clic DERECHO para definir fuente"

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.fi.po

@@ -3608,6 +3608,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgstr ""
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgstr ""

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.fr.po

@@ -3637,6 +3637,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgstr "RGB"
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgstr "Utiliser le clic DROIT pour définir la source"

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.it.po

@@ -3624,6 +3624,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgstr ""
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgstr ""

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.ja.po

@@ -3613,6 +3613,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgstr ""
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgstr ""

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.kab.po

@@ -3639,6 +3639,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgstr "RGB"
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgstr "Seqdec asiti ayfus iwakken ad tesbaduḍ aɣbalu"

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.lv.po

@@ -3641,6 +3641,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgstr "RGB"
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgstr "Ar peles labo pogu norādi avotu"

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.nl.po

@@ -3638,6 +3638,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgstr "RGB"
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgstr "Gebruik RECHTS klikken om de bron te definiëren"

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.pl.po

@@ -3633,6 +3633,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgstr "RGB"
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgstr "Użyj prawokliku, aby zdefiniować źródło"

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.pot

@@ -3436,6 +3436,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgstr ""
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgstr ""

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.pt_BR.po

@@ -3628,6 +3628,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgstr "RGB"
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgstr "Use o botão DIREITO para definir a origem"

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.ru.po

@@ -3598,6 +3598,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgstr "RGB"
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgstr "Правый клик для установки источника"

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.sv.po

@@ -3619,6 +3619,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgstr "RGB"
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgstr "Använd Högerklick för att välja källa"

+ 4 - 0
lazpaint/release/bin/i18n/lazpaint.zh_CN.po

@@ -3634,6 +3634,10 @@ msgctxt "uresourcestrings.rsrgb"
 msgid "RGB"
 msgstr "RGB"
 
+#: uresourcestrings.rsrightclickfinishshape
+msgid "Use RIGHT click to finish shape"
+msgstr ""
+
 #: uresourcestrings.rsrightclickforsource
 msgid "Use RIGHT click to define source"
 msgstr "单击右键来定义源"

+ 2 - 12
lazpaint/tools/utool.pas

@@ -165,7 +165,7 @@ type
   TToolClass = class of TGenericTool;
 
   TToolPopupMessage= (tpmNone, tpmHoldKeyForSquare, tpmHoldKeySnapToPixel,
-    tpmReturnValides, tpmBackspaceRemoveLastPoint, tpmHoldKeyRestrictRotation,
+    tpmReturnValides, tpmBackspaceRemoveLastPoint, tpmRightClickFinishShape, tpmHoldKeyRestrictRotation,
     tpmHoldKeysScaleMode, tpmCurveModeHint, tpmBlendOpBackground,
     tpmRightClickForSource, tpmNothingToBeDeformed);
 
@@ -199,7 +199,6 @@ type
     FToolCurrentCursorPos: TPointF;
     FSleepingTool: TGenericTool;
     FSleepingToolType: TPaintToolType;
-    FReturnValidatesHintShown: boolean;
     FOnToolChangedHandler: TOnToolChangedHandler;
     FOnToolRenderChanged: TNotifyEvent;
     FOnToolbarChanged: TNotifyEvent;
@@ -499,7 +498,6 @@ type
     function ToolUpdate: boolean;
     function ToolUpdateNeeded: boolean;
     procedure ToolPopup(AMessage: TToolPopupMessage; AKey: Word = 0; AAlways: boolean = false);
-    procedure HintReturnValidates;
 
     function IsSelectingTool: boolean;
     function DisplayFilledSelection: boolean;
@@ -759,6 +757,7 @@ begin
   tpmHoldKeySnapToPixel: result := ReplaceKey(rsHoldKeySnapToPixel, AKey);
   tpmReturnValides: result := rsReturnValides;
   tpmBackspaceRemoveLastPoint: result := rsBackspaceRemoveLastPoint;
+  tpmRightClickFinishShape: result := rsRightClickFinishShape;
   tpmHoldKeyRestrictRotation: result := ReplaceKey(rsHoldKeyRestrictRotation, AKey);
   tpmHoldKeysScaleMode: result := ReplaceKey(ReplaceKey(rsHoldKeysScaleMode, AKey, 2), VK_MENU);
   tpmCurveModeHint: result := rsCurveModeHint;
@@ -790,15 +789,6 @@ begin
     Result:= Manager.Image.SelectionLayerReadonly;
 end;
 
-procedure TToolManager.HintReturnValidates;
-begin
-  if not FReturnValidatesHintShown then
-  begin
-    ToolPopup(tpmReturnValides);
-    FReturnValidatesHintShown:= true;
-  end;
-end;
-
 { TGenericTool }
 
 {$hints off}

+ 9 - 3
lazpaint/tools/utoolbasic.pas

@@ -46,7 +46,7 @@ type
 
   TToolPen = class(TGenericTool)
   protected
-    class var HintShowed: boolean;
+    class var HintShown: boolean;
     penDrawing, penDrawingRight: boolean;
     shiftClicking, shiftClickingRight: boolean;
     penOrigin: TPointF;
@@ -59,6 +59,7 @@ type
     function DoToolMove(toolDest: TBGRABitmap; pt: TPoint; ptF: TPointF): TRect; override;
     function DoToolShiftClick(toolDest: TBGRABitmap; ptF: TPointF; rightBtn: boolean): TRect; virtual;
   public
+    class procedure ForgetHintShown;
     function ToolUp: TRect; override;
     function GetContextualToolbars: TContextualToolbars; override;
     destructor Destroy; override;
@@ -369,10 +370,10 @@ end;
 
 function TToolPen.DoToolMove(toolDest: TBGRABitmap; pt: TPoint; ptF: TPointF): TRect;
 begin
-  if (manager.PenWidth <= 3) and not HintShowed then
+  if (manager.PenWidth <= 3) and not HintShown then
   begin
     Manager.ToolPopup(tpmHoldKeySnapToPixel, VK_CONTROL);
-    HintShowed:= true;
+    HintShown:= true;
   end;
   if ssSnap in ShiftState then ptF := PointF(pt.X,pt.Y);
   result := EmptyRect;
@@ -397,6 +398,11 @@ begin
   result := EmptyRect;
 end;
 
+class procedure TToolPen.ForgetHintShown;
+begin
+  HintShown:= false;
+end;
+
 function TToolPen.ToolUp: TRect;
 begin
   if penDrawing then

+ 12 - 1
lazpaint/tools/utoolbrush.pas

@@ -54,6 +54,7 @@ type
 
   TToolClone = class(TToolGenericBrush)
   protected
+    class var RightClickHintShown: boolean;
     definingSource: boolean;
     class var sourceLayerId: integer;
     class var sourcePosition: TPoint;
@@ -67,6 +68,7 @@ type
     function DoToolMove(toolDest: TBGRABitmap; pt: TPoint; ptF: TPointF): TRect; override;
     function DoToolShiftClick({%H-}toolDest: TBGRABitmap; {%H-}ptF: TPointF; {%H-}rightBtn: boolean): TRect; override;
   public
+    class procedure ForgetHintShown;
     function SubPixelAccuracy: boolean; override;
     constructor Create(AManager: TToolManager); override;
     destructor Destroy; override;
@@ -162,7 +164,11 @@ end;
 function TToolClone.DoToolMove(toolDest: TBGRABitmap; pt: TPoint; ptF: TPointF
   ): TRect;
 begin
-  Manager.ToolPopup(tpmRightClickForSource);
+  if not RightClickHintShown then
+  begin
+    Manager.ToolPopup(tpmRightClickForSource);
+    RightClickHintShown := true;
+  end;
   Result:=inherited DoToolMove(toolDest, pt, ptF);
 end;
 
@@ -172,6 +178,11 @@ begin
   Result:= EmptyRect;
 end;
 
+class procedure TToolClone.ForgetHintShown;
+begin
+  RightClickHintShown:= false;
+end;
+
 function TToolClone.SubPixelAccuracy: boolean;
 begin
   Result:=false;

+ 30 - 6
lazpaint/tools/utooldeformationgrid.pas

@@ -20,6 +20,7 @@ type
     function ToolDeformationGridNeeded: boolean;
     procedure ValidateDeformationGrid;
   protected
+    class var ReturnHintShown: boolean;
     deformationGridNbX,deformationGridNbY,deformationGridX,deformationGridY: integer;
     deformationGridMoving: boolean;
     deformationOrigin: TPointF;
@@ -35,6 +36,7 @@ type
     function GetIsSelectingTool: boolean; override;
     function DoToolUpdate({%H-}toolDest: TBGRABitmap): TRect; override;
   public
+    class procedure ForgetHintShown;
     constructor Create(AManager: TToolManager); override;
     function ToolUp: TRect; override;
     function GetContextualToolbars: TContextualToolbars; override;
@@ -48,7 +50,7 @@ type
 
   TToolTextureMapping = class(TGenericTool)
   private
-    class var FHintShowed: boolean;
+    class var ScaleHintShown, ReturnHintShown: boolean;
     FCurrentBounds: TRect;
     FLastTexture: TBGRABitmap;
     FTextureAfterAlpha: TBGRABitmap;
@@ -89,6 +91,7 @@ type
     function GetStatusText: string; override;
     function GetAllowedBackFillTypes: TVectorialFillTypes; override;
   public
+    class procedure ForgetHintShown;
     constructor Create(AManager: TToolManager); override;
     function ToolUp: TRect; override;
     function GetContextualToolbars: TContextualToolbars; override;
@@ -526,12 +529,11 @@ begin
   end;
 
   result := EmptyRect;
-  if not FHintShowed then
+  if not ScaleHintShown then
   begin
     Manager.ToolPopup(tpmHoldKeysScaleMode, VK_SHIFT);
-    FHintShowed:= true;
+    ScaleHintShown:= true;
   end;
-  Manager.HintReturnValidates;
   if quadMoving then
   begin
     if quadMovingIndex = -1 then
@@ -724,6 +726,12 @@ begin
   Result:= [vftTexture];
 end;
 
+class procedure TToolTextureMapping.ForgetHintShown;
+begin
+  ScaleHintShown:= false;
+  ReturnHintShown:= false;
+end;
+
 constructor TToolTextureMapping.Create(AManager: TToolManager);
 begin
   inherited Create(AManager);
@@ -783,6 +791,11 @@ begin
     DrawQuad;
     FCanReadaptTexture:= false;
     result := FCurrentBounds;
+    if not ReturnHintShown then
+    begin
+      Manager.ToolPopup(tpmreturnValides);
+      ReturnHintShown:= true;
+    end;
     exit;
   end;
   if quadMoving then
@@ -1034,7 +1047,6 @@ var xb,yb,NbX,NbY: integer;
 
 begin
   result := EmptyRect;
-  Manager.HintReturnValidates;
 
   if not deformationGridMoving then
   begin
@@ -1192,6 +1204,11 @@ begin
     result := EmptyRect;
 end;
 
+class procedure TToolDeformationGrid.ForgetHintShown;
+begin
+  ReturnHintShown := false;
+end;
+
 constructor TToolDeformationGrid.Create(AManager: TToolManager);
 begin
   inherited Create(AManager);
@@ -1278,7 +1295,14 @@ end;
 function TToolDeformationGrid.ToolUp: TRect;
 begin
   if deformationGridMoving then
-    result := OnlyRenderChange
+  begin
+    result := OnlyRenderChange;
+    if not ReturnHintShown then
+    begin
+      Manager.ToolPopup(tpmreturnValides);
+      ReturnHintShown := true;
+    end;
+  end
   else
     Result:=EmptyRect;
   deformationGridMoving := false;

+ 21 - 0
lazpaint/tools/utoolpolygon.pas

@@ -32,6 +32,8 @@ type
 
   TToolPolygon = class(TVectorialTool)
   protected
+    class var RightClickHintShown: boolean;
+    class var RemovePointHintShown: boolean;
     initiallyClosed : boolean;
     function ShapeClass: TVectorShapeAny; override;
     function CreateShape: TVectorShape; override;
@@ -44,6 +46,7 @@ type
     function DoToolKeyDown(var key: Word): TRect; override;
     function RoundCoordinate(constref ptF: TPointF): TPointF; override;
   public
+    class procedure ForgetHintShown;
     function ToolUp: TRect; override;
     function ToolKeyPress(var key: TUTF8Char): TRect; override;
   end;
@@ -285,6 +288,11 @@ function TToolPolygon.CreateShape: TVectorShape;
 begin
   result := inherited CreateShape;
   initiallyClosed := ShouldCloseShape;
+  if not RightClickHintShown then
+  begin
+    Manager.ToolPopup(tpmRightClickFinishShape);
+    RightClickHintShown := true;
+  end;
 end;
 
 function TToolPolygon.ShouldCloseShape: boolean;
@@ -336,7 +344,14 @@ function TToolPolygon.ToolUp: TRect;
 begin
   Result:=inherited ToolUp;
   if Assigned(FShape) then
+  begin
     UpdateManagerCloseShape((FShape as TCustomPolypointShape).Closed);
+    if not RemovePointHintShown and ((FShape as TCustomPolypointShape).ValidatedPointCount >= 3) then
+    begin
+      Manager.ToolPopup(tpmBackspaceRemoveLastPoint);
+      RemovePointHintShown := true;
+    end;
+  end;
 end;
 
 function TToolPolygon.ToolKeyPress(var key: TUTF8Char): TRect;
@@ -376,6 +391,12 @@ begin
     result := ptF;
 end;
 
+class procedure TToolPolygon.ForgetHintShown;
+begin
+  RemovePointHintShown := false;
+  RemovePointHintShown := false;
+end;
+
 initialization
 
   RegisterTool(ptRect,TToolRectangle);

+ 9 - 3
lazpaint/tools/utoolselect.pas

@@ -118,7 +118,7 @@ type
 
   TToolRotateSelection = class(TTransformSelectionTool)
   protected
-    class var HintShowed: boolean;
+    class var HintShown: boolean;
     FHandRotating, FHandTranslating: boolean;
     FHandOrigin: TPointF;
     FSnapMode: boolean;
@@ -135,6 +135,7 @@ type
     function GetStatusText: string; override;
     procedure UpdateTransform;
   public
+    class procedure ForgetHintShown;
     constructor Create(AManager: TToolManager); override;
     function ToolUp: TRect; override;
     function Render(VirtualScreen: TBGRABitmap; {%H-}VirtualScreenWidth, {%H-}VirtualScreenHeight: integer; BitmapToVirtualScreen: TBitmapToVirtualScreenFunction):TRect; override;
@@ -421,10 +422,10 @@ function TToolRotateSelection.DoToolMove(toolDest: TBGRABitmap; pt: TPoint;
 var angleDiff: single;
   finalCenter, newOfs: TPointF;
 begin
-  if not HintShowed then
+  if not HintShown then
   begin
     Manager.ToolPopup(tpmHoldKeyRestrictRotation, VK_CONTROL);
-    HintShowed:= true;
+    HintShown:= true;
   end;
   if FHandRotating and ((FHandOrigin.X <> ptF.X) or (FHandOrigin.Y <> ptF.Y)) then
   begin
@@ -480,6 +481,11 @@ begin
                                    FOriginalTransform;
 end;
 
+class procedure TToolRotateSelection.ForgetHintShown;
+begin
+  HintShown:= false;
+end;
+
 constructor TToolRotateSelection.Create(AManager: TToolManager);
 begin
   inherited Create(AManager);

+ 11 - 1
lazpaint/tools/utoolvectorial.pas

@@ -28,6 +28,7 @@ type
     function GetIsHandDrawing: boolean;
     function GetIsIdle: boolean;
   protected
+    class var SquareHintShown: boolean;
     FLayerWasEmpty: boolean;
     FShape: TVectorShape;
     FTemporaryStorage: TBGRACustomOriginalStorage;
@@ -90,6 +91,7 @@ type
     function GetGridMatrix: TAffineMatrix; virtual;
     property Editor: TBGRAOriginalEditor read GetEditor;
   public
+    class procedure ForgetHintShown;
     function ValidateShape: TRect;
     function CancelShape: TRect;
     constructor Create(AManager: TToolManager); override;
@@ -1823,6 +1825,11 @@ begin
   end;
 end;
 
+class procedure TVectorialTool.ForgetHintShown;
+begin
+  SquareHintShown:= false;
+end;
+
 function TVectorialTool.ValidateShape: TRect;
 var
   layerId: LongInt;
@@ -2136,8 +2143,11 @@ begin
       FShape.OnEditingChange:=@ShapeEditingChange;
       FShape.OnRemoveQuery:= @ShapeRemoveQuery;
       result := RectUnion(result, UpdateShape(toolDest));
-      if FShape is TCustomRectShape then
+      if not SquareHintShown and (FShape is TCustomRectShape) then
+      begin
+        SquareHintShown := true;
         Manager.ToolPopup(tpmHoldKeyForSquare, VK_SHIFT);
+      end;
     end;
   end;
 end;

+ 1 - 0
lazpaint/uloading.pas

@@ -127,6 +127,7 @@ begin
     Timer1.Enabled:= false
   else
     begin
+      Timer1.Enabled := false;
       Timer1.Interval := AMillisecond;
       Timer1.Enabled := true;
     end;

+ 1 - 0
lazpaint/uresourcestrings.pas

@@ -87,6 +87,7 @@ resourcestring
   rsHoldKeySnapToPixel = 'Hold %1 to snap to pixels';
   rsReturnValides = 'Press ENTER to validate';
   rsBackspaceRemoveLastPoint = 'Press BACKSPACE to remove last point';
+  rsRightClickFinishShape = 'Use RIGHT click to finish shape';
   rsHoldKeyRestrictRotation = 'Hold %1 to restrict rotation angle';
   rsHoldKeysScaleMode = 'Hold %1 or %2 to scale';
   rsCurveModeHint = 'Press S or X to set the curve mode of the last point';

+ 10 - 0
lazpaintcontrols/lcvectorpolyshapes.pas

@@ -67,6 +67,7 @@ type
     function GetLineCap: TPenEndCap;
     function GetPoint(AIndex: integer): TPointF;
     function GetPointCount: integer;
+    function GetValidatedPointCount: integer;
     procedure SetArrowEndKind(AValue: TArrowKind);
     procedure SetArrowSize(AValue: TPointF);
     procedure SetArrowStartKind(AValue: TArrowKind);
@@ -128,6 +129,7 @@ type
     class function DefaultArrowSize: TPointF;
     property Points[AIndex:integer]: TPointF read GetPoint write SetPoint;
     property PointCount: integer read GetPointCount;
+    property ValidatedPointCount: integer read GetValidatedPointCount;
     property Closed: boolean read GetClosed write SetClosed;
     property HoverPoint: integer read GetHoverPoint write SetHoverPoint;
     property HoverCenter: boolean read FHoverCenter write SetHoverCenter;
@@ -476,6 +478,14 @@ begin
   result:= length(FPoints);
 end;
 
+function TCustomPolypointShape.GetValidatedPointCount: integer;
+begin
+  if (PointCount > 1) and FAddingPoint then
+    result := PointCount - 1
+  else
+    result := PointCount;
+end;
+
 procedure TCustomPolypointShape.SetArrowEndKind(AValue: TArrowKind);
 begin
   if FArrowEndKind=AValue then Exit;