From 0a5e04e688e293c1c4ecc0b0272b20d44dc828aa Mon Sep 17 00:00:00 2001 From: circular17 Date: Fri, 6 Mar 2020 21:25:04 +0100 Subject: [PATCH 01/53] update Windows staging script --- lazpaint/release/windows/stage.bat | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/lazpaint/release/windows/stage.bat b/lazpaint/release/windows/stage.bat index f8ab6726..2a0133a4 100644 --- a/lazpaint/release/windows/stage.bat +++ b/lazpaint/release/windows/stage.bat @@ -5,10 +5,14 @@ echo Cleaning previous staging files... if exist lazpaint32 del /s /q lazpaint32 >nul if exist lazpaint32\i18n rmdir lazpaint32\i18n if exist lazpaint32\models rmdir lazpaint32\models +if exist lazpaint32\scripts\lazpaint rmdir lazpaint32\scripts\lazpaint +if exist lazpaint32\scripts rmdir lazpaint32\scripts if exist lazpaint32 rmdir lazpaint32 if exist lazpaint64 del /s /q lazpaint64 >nul if exist lazpaint64\i18n rmdir lazpaint64\i18n if exist lazpaint64\models rmdir lazpaint64\models +if exist lazpaint64\scripts\lazpaint rmdir lazpaint64\scripts\lazpaint +if exist lazpaint64\scripts rmdir lazpaint64\scripts if exist lazpaint64 rmdir lazpaint64 echo Binary found: @@ -19,13 +23,19 @@ echo Staging 32-bit version... if not exist lazpaint32 mkdir lazpaint32 copy ..\bin\lazpaint32.exe lazpaint32\lazpaint.exe >nul copy dcraw\dcraw32.exe lazpaint32\dcraw.exe >nul +copy libwebp\libwebp32.dll lazpaint32 >nul copy ..\bin\readme.txt lazpaint32 >nul copy ..\bin\*.ini lazpaint32 >nul if not exist lazpaint32\i18n mkdir lazpaint32\i18n copy ..\bin\i18n\lazpaint.* lazpaint32\i18n >nul +copy ..\bin\i18n\lcresourcestring.* lazpaint32\i18n >nul copy ..\bin\i18n\lclstrconsts.* lazpaint32\i18n >nul if not exist lazpaint32\models mkdir lazpaint32\models copy ..\bin\models lazpaint32\models >nul +if not exist lazpaint32\scripts mkdir lazpaint32\scripts +copy ..\..\..\scripts lazpaint32\scripts >nul +if not exist lazpaint32\scripts\lazpaint mkdir lazpaint32\scripts\lazpaint +copy ..\..\..\scripts\lazpaint lazpaint32\scripts\lazpaint >nul goto donebin32 :missingbin32 echo Error: 32-bit binary not found @@ -36,13 +46,19 @@ echo Staging 64-bit version... if not exist lazpaint64 mkdir lazpaint64 copy ..\bin\lazpaint_x64.exe lazpaint64\lazpaint.exe >nul copy dcraw\dcraw_x64.exe lazpaint64\dcraw.exe >nul -copy ..\bin\readme.txt lazpaint32 >nul -copy ..\bin\*.ini lazpaint32 >nul +copy libwebp\libwebp64.dll lazpaint64 >nul +copy ..\bin\readme.txt lazpaint64 >nul +copy ..\bin\*.ini lazpaint64 >nul if not exist lazpaint64\i18n mkdir lazpaint64\i18n copy ..\bin\i18n\lazpaint.* lazpaint64\i18n >nul +copy ..\bin\i18n\lcresourcestring.* lazpaint64\i18n >nul copy ..\bin\i18n\lclstrconsts.* lazpaint64\i18n >nul if not exist lazpaint64\models mkdir lazpaint64\models copy ..\bin\models lazpaint64\models >nul +if not exist lazpaint64\scripts mkdir lazpaint64\scripts +copy ..\..\..\scripts lazpaint64\scripts >nul +if not exist lazpaint64\scripts\lazpaint mkdir lazpaint64\scripts\lazpaint +copy ..\..\..\scripts\lazpaint lazpaint64\scripts\lazpaint >nul goto donebin64 :missingbin64 echo Error: 64-bit binary not found From 1a8975a5c8a8884e425ce47ba8ee0d99818b255b Mon Sep 17 00:00:00 2001 From: johann Date: Sat, 7 Mar 2020 19:17:05 +0100 Subject: [PATCH 02/53] bring toolwindow to front on restore --- lazpaint/lazpaintinstance.pas | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lazpaint/lazpaintinstance.pas b/lazpaint/lazpaintinstance.pas index 4b2d0f8c..dd528063 100644 --- a/lazpaint/lazpaintinstance.pas +++ b/lazpaint/lazpaintinstance.pas @@ -1462,17 +1462,20 @@ procedure TLazPaintInstance.ShowTopmost(AInfo: TTopMostInfo); if Assigned(FLayerStack) and (AInfo.layerstackHidden > 0) then begin FLayerStack.Show; + FLayerStack.BringToFront; FLayerStack.InvalidateStack(False); dec(FTopMostInfo.layerstackHidden); end; if Assigned(FChooseColor) and (AInfo.choosecolorHidden > 0) then begin FChooseColor.Show; + FChooseColor.BringToFront; dec(FTopMostInfo.choosecolorHidden); end; if Assigned(FFormToolbox) and (AInfo.toolboxHidden > 0) then begin FFormToolbox.Show; + FFormToolbox.BringToFront; dec(FTopMostInfo.toolboxHidden); end; end; From 525614e5c5d58fb22d6dce7cc0845a6410edc501 Mon Sep 17 00:00:00 2001 From: johann Date: Sun, 8 Mar 2020 11:42:10 +0100 Subject: [PATCH 03/53] less flickering (resizing, rotating image) --- lazpaint/lazpaintinstance.pas | 63 +++++++++++++++++++++++++++-------- lazpaint/lazpaintmainform.pas | 13 ++++++++ lazpaint/uimageview.pas | 39 +++++++++++++--------- lazpaint/umainformlayout.pas | 13 ++++++-- lazpaint/umenu.pas | 1 + lazpaint/upalettetoolbar.pas | 1 + 6 files changed, 99 insertions(+), 31 deletions(-) diff --git a/lazpaint/lazpaintinstance.pas b/lazpaint/lazpaintinstance.pas index dd528063..020a6bdd 100644 --- a/lazpaint/lazpaintinstance.pas +++ b/lazpaint/lazpaintinstance.pas @@ -657,8 +657,13 @@ procedure TLazPaintInstance.OnImageActionProgress(ASender: TObject; delay: Integer; begin if AProgressPercent < 100 then delay := 10000 else delay := 1000; - MessagePopup(rsActionInProgress+'... '+inttostr(AProgressPercent)+'%', delay); - UpdateWindows; + if Assigned(FMain) then FMain.UpdatingPopup:= true; + try + MessagePopup(rsActionInProgress+'... '+inttostr(AProgressPercent)+'%', delay); + UpdateWindows; + finally + if Assigned(FMain) then FMain.UpdatingPopup:= false; + end; end; function TLazPaintInstance.GetInitialized: boolean; @@ -796,8 +801,13 @@ procedure TLazPaintInstance.OnLayeredBitmapLoadStartHandler(AFilenameUTF8: strin begin if FLoadingLayers = nil then FLoadingLayers := TFLoading.Create(nil); if (AFilenameUTF8 = '') and (FLoadingFilename <> '') then AFilenameUTF8 := FLoadingFilename; - FLoadingLayers.ShowMessage(rsOpening+' ' +AFilenameUTF8+'...'); - UpdateWindows; + if Assigned(FMain) then FMain.UpdatingPopup:= true; + try + FLoadingLayers.ShowMessage(rsOpening+' ' +AFilenameUTF8+'...'); + UpdateWindows; + finally + if Assigned(FMain) then FMain.UpdatingPopup:= false; + end; end; procedure TLazPaintInstance.OnLayeredBitmapLoadProgressHandler( @@ -805,8 +815,13 @@ procedure TLazPaintInstance.OnLayeredBitmapLoadProgressHandler( begin if FLoadingLayers <> nil then begin - FLoadingLayers.ShowMessage(rsLoading+' (' +inttostr(APercentage)+'%)'); - UpdateWindows; + if Assigned(FMain) then FMain.UpdatingPopup:= true; + try + FLoadingLayers.ShowMessage(rsLoading+' (' +inttostr(APercentage)+'%)'); + UpdateWindows; + finally + if Assigned(FMain) then FMain.UpdatingPopup:= false; + end; end; end; @@ -814,8 +829,13 @@ procedure TLazPaintInstance.OnLayeredBitmapLoadedHandler; begin if FLoadingLayers <> nil then begin - FreeAndNil(FLoadingLayers); - UpdateWindows; + if Assigned(FMain) then FMain.UpdatingPopup:= true; + try + FreeAndNil(FLoadingLayers); + UpdateWindows; + finally + if Assigned(FMain) then FMain.UpdatingPopup:= false; + end; end; end; @@ -823,8 +843,13 @@ procedure TLazPaintInstance.OnLayeredBitmapSavedHandler(); begin if FLoadingLayers <> nil then begin - FreeAndNil(FLoadingLayers); - UpdateWindows; + if Assigned(FMain) then FMain.UpdatingPopup:= true; + try + FreeAndNil(FLoadingLayers); + UpdateWindows; + finally + if Assigned(FMain) then FMain.UpdatingPopup:= false; + end; end; end; @@ -833,8 +858,13 @@ procedure TLazPaintInstance.OnLayeredBitmapSaveProgressHandler( begin if FLoadingLayers <> nil then begin - FLoadingLayers.ShowMessage(rsSave+' (' +inttostr(APercentage)+'%)'); - UpdateWindows; + if Assigned(FMain) then FMain.UpdatingPopup:= true; + try + FLoadingLayers.ShowMessage(rsSave+' (' +inttostr(APercentage)+'%)'); + UpdateWindows; + finally + if Assigned(FMain) then FMain.UpdatingPopup:= false; + end; end; end; @@ -843,8 +873,13 @@ procedure TLazPaintInstance.OnLayeredBitmapSaveStartHandler( begin if FLoadingLayers = nil then FLoadingLayers := TFLoading.Create(nil); if (AFilenameUTF8 = '') and (FSavingFilename <> '') then AFilenameUTF8 := FSavingFilename; - FLoadingLayers.ShowMessage(rsSave+' ' +AFilenameUTF8+'...'); - UpdateWindows; + if Assigned(FMain) then FMain.UpdatingPopup:= true; + try + FLoadingLayers.ShowMessage(rsSave+' ' +AFilenameUTF8+'...'); + UpdateWindows; + finally + if Assigned(FMain) then FMain.UpdatingPopup:= false; + end; end; procedure TLazPaintInstance.PythonBusy(Sender: TObject); diff --git a/lazpaint/lazpaintmainform.pas b/lazpaint/lazpaintmainform.pas index 4133765b..352dae8f 100644 --- a/lazpaint/lazpaintmainform.pas +++ b/lazpaint/lazpaintmainform.pas @@ -751,8 +751,10 @@ TFMain = class(TForm) function GetCurrentPressure: single; function GetDarkTheme: boolean; + function GetUpdatingPopup: boolean; function GetUseImageBrowser: boolean; procedure SetDarkTheme(AValue: boolean); + procedure SetUpdatingPopup(AValue: boolean); procedure UpdateStatusText; procedure CreateToolbarElements; function GetCurrentToolAction: TAction; @@ -889,6 +891,7 @@ TFMain = class(TForm) property CurrentPressure: single read GetCurrentPressure; property DarkTheme: boolean read GetDarkTheme write SetDarkTheme; property Initialized: boolean read FInitialized; + property UpdatingPopup: boolean read GetUpdatingPopup write SetUpdatingPopup; end; implementation @@ -4590,6 +4593,11 @@ procedure TFMain.SetDarkTheme(AValue: boolean); end; end; +procedure TFMain.SetUpdatingPopup(AValue: boolean); +begin + FImageView.UpdatingPopup := AValue; +end; + function TFMain.GetCurrentPressure: single; begin if Assigned(FTablet) and FTablet.Present and FTablet.Entering and (FTablet.Max > 0) then @@ -4604,6 +4612,11 @@ function TFMain.GetDarkTheme: boolean; else result := false; end; +function TFMain.GetUpdatingPopup: boolean; +begin + result := FImageView.UpdatingPopup; +end; + function TFMain.GetScriptContext: TScriptContext; begin result := LazPaintInstance.ScriptContext; diff --git a/lazpaint/uimageview.pas b/lazpaint/uimageview.pas index ec7895c9..2c5c350c 100644 --- a/lazpaint/uimageview.pas +++ b/lazpaint/uimageview.pas @@ -16,6 +16,7 @@ interface TImageView = class protected FVirtualScreen : TBGRABitmap; + FUpdatingPopup: boolean; FPenCursorVisible: boolean; FPenCursorPos,FPenCursorPosBefore: TVSCursorPosition; FQueryPaintVirtualScreen: boolean; @@ -73,6 +74,7 @@ TImageView = class property ShowSelection: boolean read FShowSelection write SetShowSelection; property WorkspaceColor: TColor read GetWorkspaceColor; property PictureCoordsDefined: boolean read GetPictureCoordsDefined; + property UpdatingPopup: boolean read FUpdatingPopup write FUpdatingPopup; end; implementation @@ -159,29 +161,36 @@ procedure TImageView.PaintPictureImplementation(ACanvasOfs: TPoint; AWorkArea: T FreeAndNil(FVirtualScreen); if not Assigned(FVirtualScreen) then + begin FVirtualScreen := TBGRABitmap.Create(FLastPictureParameters.virtualScreenArea.Right-FLastPictureParameters.virtualScreenArea.Left, FLastPictureParameters.virtualScreenArea.Bottom-FLastPictureParameters.virtualScreenArea.Top, WorkspaceColor); + end else + begin + if picParamWereDefined then FVirtualScreen.ClipRect := GetRenderUpdateRectVS(False); + end; - if picParamWereDefined then FVirtualScreen.ClipRect := GetRenderUpdateRectVS(False); - Image.ResetRenderUpdateRect; - - if not FVirtualScreen.ClipRect.IsEmpty then + if not FUpdatingPopup then begin - renderRect := FLastPictureParameters.scaledArea; - OffsetRect(renderRect, -FLastPictureParameters.virtualScreenArea.Left, - -FLastPictureParameters.virtualScreenArea.Top); + Image.ResetRenderUpdateRect; + + if not FVirtualScreen.ClipRect.IsEmpty then + begin + renderRect := FLastPictureParameters.scaledArea; + OffsetRect(renderRect, -FLastPictureParameters.virtualScreenArea.Left, + -FLastPictureParameters.virtualScreenArea.Top); - DrawThumbnailCheckers(FVirtualScreen,renderRect,Image.IsIconCursor); + DrawThumbnailCheckers(FVirtualScreen,renderRect,Image.IsIconCursor); - //draw image (with merged selection) - FVirtualScreen.StretchPutImage(renderRect,Image.RenderedImage,dmDrawWithTransparency); - if (Zoom.Factor > DoScaleX(MinZoomForGrid, OriginalDPI)) and LazPaintInstance.GridVisible then - DrawGrid(FVirtualScreen,FLastPictureParameters.zoomFactorX,FLastPictureParameters.zoomFactorY, - FLastPictureParameters.originInVS.X,FLastPictureParameters.originInVS.Y); + //draw image (with merged selection) + FVirtualScreen.StretchPutImage(renderRect,Image.RenderedImage,dmDrawWithTransparency); + if (Zoom.Factor > DoScaleX(MinZoomForGrid, OriginalDPI)) and LazPaintInstance.GridVisible then + DrawGrid(FVirtualScreen,FLastPictureParameters.zoomFactorX,FLastPictureParameters.zoomFactorY, + FLastPictureParameters.originInVS.X,FLastPictureParameters.originInVS.Y); - DrawSelectionHighlight(renderRect); + DrawSelectionHighlight(renderRect); + end; + FVirtualScreen.NoClip; end; - FVirtualScreen.NoClip; //show tools info LazPaintInstance.ToolManager.RenderTool(FVirtualScreen); diff --git a/lazpaint/umainformlayout.pas b/lazpaint/umainformlayout.pas index 7ab259dd..ee478c21 100644 --- a/lazpaint/umainformlayout.pas +++ b/lazpaint/umainformlayout.pas @@ -165,12 +165,14 @@ constructor TMainFormLayout.Create(AForm: TForm); FDockedControlsPanel := TPanel.Create(nil); FDockedControlsPanel.Visible := false; + FDockedControlsPanel.Anchors:= [akRight,akTop,akBottom]; FForm.InsertControl(FDockedControlsPanel); FStatusBar := TStatusBar.Create(nil); FStatusBar.SizeGrip := false; FStatusBar.Align := alNone; FStatusBar.Visible := false; + FStatusBar.Anchors := [akLeft,akRight,akBottom]; FForm.InsertControl(FStatusBar); ApplyTheme; @@ -446,8 +448,15 @@ procedure TMainFormLayout.DoArrange; w := FDockedToolBoxToolBar.ButtonWidth * nbX+2; FDockedToolBoxToolBar.Width := w; FPanelToolBox.Width := w; - if FToolBoxDocking = twLeft then FPanelToolBox.Left:= Left - else FPanelToolBox.Left:= Right-FPanelToolBox.Width; + if FToolBoxDocking = twLeft then + begin + FPanelToolBox.Left:= Left; + FPanelToolBox.Anchors:= [akLeft,akTop,akBottom]; + end else + begin + FPanelToolBox.Left:= Right-FPanelToolBox.Width; + FPanelToolBox.Anchors:= [akRight,akTop,akBottom]; + end; for i := 0 to FDockedToolBoxToolBar.ButtonCount-1 do FDockedToolBoxToolBar.Buttons[i].Top := i*FDockedToolBoxToolBar.ButtonHeight; end; diff --git a/lazpaint/umenu.pas b/lazpaint/umenu.pas index 1a0f575a..89638e91 100644 --- a/lazpaint/umenu.pas +++ b/lazpaint/umenu.pas @@ -557,6 +557,7 @@ procedure TMainFormMenu.ArrangeToolbars(ClientWidth: integer); FToolbarBackground.Left := 0; FToolbarBackground.width := ClientWidth; FToolbarBackground.Height := FToolbarsHeight; + FToolbarBackground.Anchors:= [akLeft,akTop,akRight]; FToolbarBackground.Visible := true; end; end; diff --git a/lazpaint/upalettetoolbar.pas b/lazpaint/upalettetoolbar.pas index 506a4c02..5e200167 100644 --- a/lazpaint/upalettetoolbar.pas +++ b/lazpaint/upalettetoolbar.pas @@ -473,6 +473,7 @@ function TPaletteToolbar.GetPanelPalette: TBGRAVirtualScreen; FPaletteAlphaWidth := FPaletteItemWidth div 3; FPanelPalette := TBGRAVirtualScreen.Create(nil); + FPanelPalette.Anchors:= [akTop,akRight,akBottom]; FPanelPalette.Width := DoScaleX(FPaletteItemWidth, OriginalDPI)+VolatileScrollBarSize; FPanelPalette.Visible := false; FPanelPalette.OnRedraw := @RepaintPalette; From 202bbbab4393b603c9f8d0cbc1f7ddbcdabccdfc Mon Sep 17 00:00:00 2001 From: johann Date: Sun, 8 Mar 2020 12:00:49 +0100 Subject: [PATCH 04/53] script: layer shadow scale offset --- scripts/layer_shadow.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/layer_shadow.py b/scripts/layer_shadow.py index 1cfc1886..8c97143f 100644 --- a/scripts/layer_shadow.py +++ b/scripts/layer_shadow.py @@ -176,7 +176,7 @@ def scale_opacity_update(event): label_radius = Label(frame, text="Radius:") label_radius.grid(column=0, row=0) scale_radius = Scale(frame, from_=0, to=MAX_RADIUS, orient=HORIZONTAL, command=scale_radius_update) -scale_radius.grid(column=1, row=0, columnspan=2, sticky=W+E, padx=10) +scale_radius.grid(column=1, row=0, sticky=W+E, padx=10) scale_radius.set(chosen_radius) label_offset = Label(frame, text="Offset:") @@ -185,21 +185,21 @@ def scale_opacity_update(event): scale_offset_x.grid(column=1, row=1, sticky=W+E, padx=10) scale_offset_x.set(chosen_offset[0]) scale_offset_y = Scale(frame, from_=-MAX_OFFSET, to=MAX_OFFSET, orient=HORIZONTAL, command=scale_offset_update) -scale_offset_y.grid(column=2, row=1, sticky=W+E, padx=10) +scale_offset_y.grid(column=1, row=2, sticky=W+E, padx=10) scale_offset_y.set(chosen_offset[1]) label_opacity = Label(frame, text="Opacity:") -label_opacity.grid(column=0, row=2) +label_opacity.grid(column=0, row=3) scale_opacity = Scale(frame, from_=0, to=MAX_OPACITY, orient=HORIZONTAL, command=scale_opacity_update) -scale_opacity.grid(column=1, row=2, columnspan=2, sticky=W+E, padx=10) +scale_opacity.grid(column=1, row=3, sticky=W+E, padx=10) scale_opacity.set(chosen_opacity) frame.columnconfigure(0, pad=20) -frame.columnconfigure(1, weight=1) -frame.columnconfigure(2, weight=1) +frame.columnconfigure(1, minsize=250) frame.rowconfigure(0, pad=20) frame.rowconfigure(1, pad=20) frame.rowconfigure(2, pad=20) +frame.rowconfigure(3, pad=20) button_ok = Button(window, text="Ok", command=button_ok_click) button_ok.pack(side=RIGHT, padx=10, pady=10) From 29da5cb70e028cfd14790d63b6971b9d3a657a40 Mon Sep 17 00:00:00 2001 From: johann Date: Sun, 8 Mar 2020 12:06:54 +0100 Subject: [PATCH 05/53] updown size was too small --- lazpaint/lazpaintmainform.lfm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lazpaint/lazpaintmainform.lfm b/lazpaint/lazpaintmainform.lfm index 07b0bd00..3cb9ba0c 100644 --- a/lazpaint/lazpaintmainform.lfm +++ b/lazpaint/lazpaintmainform.lfm @@ -228,9 +228,9 @@ object FMain: TFMain Left = 608 Height = 36 Top = 144 - Width = 98 + Width = 105 ClientHeight = 36 - ClientWidth = 98 + ClientWidth = 105 Font.Height = -12 ParentColor = False ParentFont = False @@ -252,7 +252,7 @@ object FMain: TFMain Height = 20 Hint = 'Pen width' Top = 2 - Width = 46 + Width = 53 AllowNegativeValues = False BarExponent = 1 Increment = 1 @@ -718,9 +718,9 @@ object FMain: TFMain Left = 608 Height = 36 Top = 8 - Width = 72 + Width = 75 ClientHeight = 36 - ClientWidth = 72 + ClientWidth = 75 Font.Height = -12 ParentColor = False ParentFont = False @@ -731,7 +731,7 @@ object FMain: TFMain Height = 20 Hint = 'Coordinates' Top = 2 - Width = 62 + Width = 66 Alignment = taCenter AutoSize = False Caption = '9999x9999' From 5f44b44d7e610f09b1bec4d4b1f0e1340ba44710 Mon Sep 17 00:00:00 2001 From: johann Date: Sun, 8 Mar 2020 13:12:29 +0100 Subject: [PATCH 06/53] optimize layer transform --- lazpaint/image/uimagediff.pas | 76 ++++++++++++++++++++++++++++++++--- lazpaint/tools/utoollayer.pas | 15 ++++--- 2 files changed, 81 insertions(+), 10 deletions(-) diff --git a/lazpaint/image/uimagediff.pas b/lazpaint/image/uimagediff.pas index 8db9cc76..c949eec3 100644 --- a/lazpaint/image/uimagediff.pas +++ b/lazpaint/image/uimagediff.pas @@ -340,10 +340,14 @@ TReplaceLayerByOriginalDifference = class(TCustomImageDifference) FPreviousLayerContent: TStoredLayer; FPrevMatrix,FNextMatrix: TAffineMatrix; FSourceBounds: TRect; + FSourceLayerId: integer; FOriginalGuid: TGUID; function GetImageDifferenceKind: TImageDifferenceKind; override; function CreateOriginal(AState: TState; ALayerIndex: integer): TBGRALayerCustomOriginal; virtual; abstract; function ShouldRenderOriginal: boolean; virtual; + procedure StorePreviousLayer(AImgState: TImageState; ALayerIndex: integer; + AAlwaysStoreBitmap: boolean); virtual; + procedure CustomUnapplyto(AState: TState); public constructor Create(AFromState: TState; AIndex: integer; AAlwaysStoreBitmap: boolean); function UsedMemory: int64; override; @@ -383,7 +387,14 @@ TDiscardOriginalDifference = class(TCustomImageDifference) TReplaceLayerByImageOriginalDifference = class(TReplaceLayerByOriginalDifference) protected + FSourceStoredInOriginal: boolean; + procedure StorePreviousLayer(AImgState: TImageState; ALayerIndex: integer; + AAlwaysStoreBitmap: boolean); override; function CreateOriginal(AState: TState; ALayerIndex: integer): TBGRALayerCustomOriginal; override; + public + function UsedMemory: int64; override; + function TryCompress: boolean; override; + procedure UnapplyTo(AState: TState); override; end; { TReplaceLayerByVectorOriginalDifference } @@ -1130,6 +1141,15 @@ constructor TReplaceLayerByVectorOriginalDifference.Create(AFromState: TState; { TReplaceLayerByImageOriginalDifference } +procedure TReplaceLayerByImageOriginalDifference.StorePreviousLayer( + AImgState: TImageState; ALayerIndex: integer; AAlwaysStoreBitmap: boolean); +begin + if not AImgState.LayerOriginalDefined[ALayerIndex] then + FSourceStoredInOriginal:= true + else + inherited StorePreviousLayer(AImgState, ALayerIndex, AAlwaysStoreBitmap); +end; + function TReplaceLayerByImageOriginalDifference.CreateOriginal(AState: TState; ALayerIndex: integer): TBGRALayerCustomOriginal; var source: TBGRABitmap; @@ -1150,6 +1170,40 @@ function TReplaceLayerByImageOriginalDifference.CreateOriginal(AState: TState; A result := orig; end; +function TReplaceLayerByImageOriginalDifference.UsedMemory: int64; +begin + if FSourceStoredInOriginal then + result := 0 + else + Result:=inherited UsedMemory; +end; + +function TReplaceLayerByImageOriginalDifference.TryCompress: boolean; +begin + if FSourceStoredInOriginal then + result := false + else Result:=inherited TryCompress; +end; + +procedure TReplaceLayerByImageOriginalDifference.UnapplyTo(AState: TState); +var + imgState: TImageState; + layerIdx: Integer; + bmp: TBGRABitmap; +begin + if FSourceStoredInOriginal then + begin + CustomUnapplyto(AState); + imgState := AState as TImageState; + layerIdx := imgState.LayeredBitmap.GetLayerIndexFromId(LayerId); + bmp := (imgState.LayeredBitmap.LayerOriginal[layerIdx] as TBGRALayerImageOriginal).GetImageCopy; + imgState.LayeredBitmap.SetLayerBitmap(layerIdx, bmp, True); + imgState.LayeredBitmap.LayerOffset[layerIdx] := Point(round(FPrevMatrix[1,3]), round(FPrevMatrix[2,3])); + imgState.LayeredBitmap.RemoveUnusedOriginals; + end else + inherited UnapplyTo(AState); +end; + { TSelectionTransformDifference } function TSelectionTransformDifference.GetImageDifferenceKind: TImageDifferenceKind; @@ -1255,7 +1309,7 @@ procedure TSelectionTransformDifference.UnapplyTo(AState: TState); function TReplaceLayerByOriginalDifference.GetLayerId: integer; begin - result := FPreviousLayerContent.LayerId; + result := FSourceLayerId; end; function TReplaceLayerByOriginalDifference.GetImageDifferenceKind: TImageDifferenceKind; @@ -1268,6 +1322,17 @@ function TReplaceLayerByOriginalDifference.ShouldRenderOriginal: boolean; result := false; end; +procedure TReplaceLayerByOriginalDifference.StorePreviousLayer( + AImgState: TImageState; ALayerIndex: integer; AAlwaysStoreBitmap: boolean); +begin + FPreviousLayerContent := TStoredLayer.Create(AImgState.LayeredBitmap, ALayerIndex, AAlwaysStoreBitmap); +end; + +procedure TReplaceLayerByOriginalDifference.CustomUnapplyto(AState: TState); +begin + inherited UnapplyTo(AState); +end; + constructor TReplaceLayerByOriginalDifference.Create( AFromState: TState; AIndex: integer; AAlwaysStoreBitmap: boolean); var @@ -1275,9 +1340,10 @@ constructor TReplaceLayerByOriginalDifference.Create( begin inherited Create(AFromState); imgState := AFromState as TImageState; - FPreviousLayerContent := TStoredLayer.Create(imgState.LayeredBitmap, AIndex, AAlwaysStoreBitmap); FSourceBounds := imgState.LayeredBitmap.LayerBitmap[AIndex].GetImageBounds; - with FPreviousLayerContent.Offset do FPrevMatrix := AffineMatrixTranslation(x+FSourceBounds.Left,y+FSourceBounds.Top); + FSourceLayerId := imgState.LayeredBitmap.LayerUniqueId[AIndex]; + with imgState.LayeredBitmap.LayerOffset[AIndex] do FPrevMatrix := AffineMatrixTranslation(x+FSourceBounds.Left,y+FSourceBounds.Top); + StorePreviousLayer(imgState, AIndex, AAlwaysStoreBitmap); FNextMatrix := FPrevMatrix; ApplyTo(imgState); end; @@ -1300,7 +1366,7 @@ procedure TReplaceLayerByOriginalDifference.ApplyTo(AState: TState); begin inherited ApplyTo(AState); imgState := AState as TImageState; - layerIdx := imgState.LayeredBitmap.GetLayerIndexFromId(FPreviousLayerContent.LayerId); + layerIdx := imgState.LayeredBitmap.GetLayerIndexFromId(FSourceLayerId); orig := CreateOriginal(imgState, layerIdx); if FOriginalGuid <> GUID_NULL then orig.Guid := FOriginalGuid; origIndex := imgState.LayeredBitmap.AddOriginal(orig, true); @@ -1321,7 +1387,7 @@ procedure TReplaceLayerByOriginalDifference.UnapplyTo(AState: TState); var imgState: TImageState; begin - inherited UnapplyTo(AState); + CustomUnapplyto(AState); imgState := AState as TImageState; FPreviousLayerContent.Replace(imgState.LayeredBitmap); end; diff --git a/lazpaint/tools/utoollayer.pas b/lazpaint/tools/utoollayer.pas index d228460d..33906e6b 100644 --- a/lazpaint/tools/utoollayer.pas +++ b/lazpaint/tools/utoollayer.pas @@ -7,7 +7,7 @@ interface uses Classes, SysUtils, UTool, BGRABitmap, BGRABitmapTypes, BGRATransform, BGRALayers, ULayerAction, UImageDiff, - UImageType; + UImageType, UStateType; type { TToolMoveLayer } @@ -570,17 +570,22 @@ procedure TToolTransformLayer.CancelTransform; procedure TToolTransformLayer.ValidateTransform; var transform: TAffineMatrix; + layerIdx: Integer; + invTransformDiff: TCustomImageDifference; + r: TRect; begin if FOriginalInit then begin if Assigned(FBackupLayer) then begin - transform := Manager.Image.LayerOriginalMatrix[Manager.Image.CurrentLayerIndex]; - Manager.Image.LayerOriginalMatrix[Manager.Image.CurrentLayerIndex] := FInitialOriginalMatrix; - Manager.Image.CurrentState.LayeredBitmap.LayerOriginalMatrix[Manager.Image.CurrentLayerIndex] := transform; - Manager.Image.CurrentState.LayeredBitmap.RenderLayerFromOriginal(Manager.Image.CurrentLayerIndex); + layerIdx := Manager.Image.CurrentLayerIndex; + transform := Manager.Image.LayerOriginalMatrix[layerIdx]; + invTransformDiff := Manager.Image.CurrentState.ComputeLayerMatrixDifference(layerIdx, + transform, FInitialOriginalMatrix); FBackupLayer.nextMatrix := transform; + Manager.Image.AddUndo(invTransformDiff); Manager.Image.AddUndo(FBackupLayer); + Manager.Image.CurrentState.LayeredBitmap.RenderLayerFromOriginalIfNecessary(layerIdx, false, r); FBackupLayer := nil; end; FOriginalInit := false; From f52a55b81a117102d1cf560b85f5c77ebfbbad1e Mon Sep 17 00:00:00 2001 From: johann Date: Sun, 8 Mar 2020 13:28:59 +0100 Subject: [PATCH 07/53] added font aliasing option --- lazpaint/tools/utooltext.pas | 3 ++- lazpaint/tools/utoolvectorial.pas | 8 +++++-- lazpaintcontrols/lcvectortextshapes.pas | 29 ++++++++++++++++++++++--- 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/lazpaint/tools/utooltext.pas b/lazpaint/tools/utooltext.pas index 0a81fa85..5d0f37cc 100644 --- a/lazpaint/tools/utooltext.pas +++ b/lazpaint/tools/utooltext.pas @@ -160,6 +160,7 @@ procedure TToolText.AssignShapeStyle(AMatrix: TAffineMatrix; AAlwaysFit: boolean FontEmHeight:= zoom*Manager.TextFontSize*Manager.Image.DPI/72; FontName:= Manager.TextFontName; FontStyle:= Manager.TextFontStyle; + Aliased := Manager.ShapeOptionAliasing; gradBox := self.SuggestGradientBox; if AAlwaysFit then fitMode := fmAlways else fitMode := ForeFitMode; @@ -246,7 +247,7 @@ constructor TToolText.Create(AManager: TToolManager); function TToolText.GetContextualToolbars: TContextualToolbars; begin - Result:= [ctPenFill,ctBackFill,ctText]; + Result:= [ctPenFill,ctBackFill,ctText,ctAliasing]; if Manager.TextPhong then include(result, ctAltitude); end; diff --git a/lazpaint/tools/utoolvectorial.pas b/lazpaint/tools/utoolvectorial.pas index e2ab528f..3c8a65f8 100644 --- a/lazpaint/tools/utoolvectorial.pas +++ b/lazpaint/tools/utoolvectorial.pas @@ -447,7 +447,6 @@ procedure TEditShapeTool.UpdateToolManagerFromShape(AShape: TVectorShape); if AShape is TCurveShape then Manager.SplineStyle := TCurveShape(AShape).SplineStyle; end; - Manager.ShapeOptions := opt; if AShape is TTextShape then with TTextShape(AShape) do @@ -464,7 +463,11 @@ procedure TEditShapeTool.UpdateToolManagerFromShape(AShape: TVectorShape); Manager.SetTextOutline(true, OutlineWidth); Manager.BackFill.Assign(OutlineFill); end; + if Aliased then + include(opt,toAliasing) + else exclude(opt,toAliasing); end; + Manager.ShapeOptions := opt; if AShape is TPhongShape then with TPhongShape(AShape) do @@ -663,6 +666,7 @@ function TEditShapeTool.DoToolUpdate(toolDest: TBGRABitmap): TRect; AssignFill(OutLineFill, Manager.BackFill, gradBox, BackFitMode); end else OutlineFill.Clear; + Aliased := Manager.ShapeOptionAliasing; end; if SelectedShape is TPhongShape then with TPhongShape(SelectedShape) do @@ -882,7 +886,7 @@ function TEditShapeTool.GetContextualToolbars: TContextualToolbars; else if shape is TPhongShape then result := result + [ctPhong,ctAltitude] else if shape is TTextShape then begin - result := result + [ctText]; + result := result + [ctText,ctAliasing]; if TTextShape(shape).PenPhong then include(result, ctAltitude); end; end; diff --git a/lazpaintcontrols/lcvectortextshapes.pas b/lazpaintcontrols/lcvectortextshapes.pas index b9321fad..8df7cb15 100644 --- a/lazpaintcontrols/lcvectortextshapes.pas +++ b/lazpaintcontrols/lcvectortextshapes.pas @@ -22,10 +22,12 @@ TTextShapeFontDiff = class(TVectorShapeDiff) FFontEmHeightBefore: single; FFontNameBefore: string; FFontStyleBefore: TFontStyles; + FAliasedBefore: boolean; FFontBidiModeAfter: TFontBidiMode; FFontEmHeightAfter: single; FFontNameAfter: string; FFontStyleAfter: TFontStyles; + FAliasedAfter: boolean; public constructor Create(AStartShape: TVectorShape); override; procedure ComputeDiff(AEndShape: TVectorShape); override; @@ -79,6 +81,7 @@ TTextShapeTextDiff = class(TVectorShapeDiff) TTextShape = class(TCustomRectShape) private + FAliased: boolean; FAltitudePercent: single; FPenPhong: boolean; FLightPosition: TPointF; @@ -99,6 +102,7 @@ TTextShape = class(TCustomRectShape) function GetParagraphAlignment: TAlignment; procedure OnMoveLightPos({%H-}ASender: TObject; {%H-}APrevCoord, ANewCoord: TPointF; {%H-}AShift: TShiftState); + procedure SetAliased(AValue: boolean); procedure SetAltitudePercent(AValue: single); procedure SetPenPhong(AValue: boolean); procedure SetFontBidiMode(AValue: TFontBidiMode); @@ -181,6 +185,7 @@ TTextShape = class(TCustomRectShape) property PenPhong: boolean read FPenPhong write SetPenPhong; property LightPosition: TPointF read FLightPosition write SetLightPosition; property AltitudePercent: single read FAltitudePercent write SetAltitudePercent; + property Aliased: boolean read FAliased write SetAliased; end; function FontStyleToStr(AStyle: TFontStyles): string; @@ -420,6 +425,7 @@ constructor TTextShapeFontDiff.Create(AStartShape: TVectorShape); FFontEmHeightBefore:= FFontEmHeight; FFontNameBefore:= FFontName; FFontStyleBefore:= FFontStyle; + FAliasedBefore := FAliased; end; end; @@ -431,6 +437,7 @@ procedure TTextShapeFontDiff.ComputeDiff(AEndShape: TVectorShape); FFontEmHeightAfter:= FFontEmHeight; FFontNameAfter:= FFontName; FFontStyleAfter:= FFontStyle; + FAliasedAfter := FAliased; end; end; @@ -443,6 +450,7 @@ procedure TTextShapeFontDiff.Apply(AStartShape: TVectorShape); FFontEmHeight := FFontEmHeightAfter; FFontName := FFontNameAfter; FFontStyle := FFontStyleAfter; + FAliased := FAliasedAfter; if Assigned(FTextLayout) then FTextLayout.InvalidateLayout; EndUpdate; end; @@ -457,6 +465,7 @@ procedure TTextShapeFontDiff.Unapply(AEndShape: TVectorShape); FFontEmHeight := FFontEmHeightBefore; FFontName := FFontNameBefore; FFontStyle := FFontStyleBefore; + FAliased := FAliasedBefore; if Assigned(FTextLayout) then FTextLayout.InvalidateLayout; EndUpdate; end; @@ -471,6 +480,7 @@ procedure TTextShapeFontDiff.Append(ADiff: TVectorShapeDiff); FFontEmHeightAfter := next.FFontEmHeightAfter; FFontNameAfter := next.FFontNameAfter; FFontStyleAfter := next.FFontStyleAfter; + FAliasedAfter := next.FAliasedAfter; end; function TTextShapeFontDiff.IsIdentity: boolean; @@ -478,7 +488,8 @@ function TTextShapeFontDiff.IsIdentity: boolean; result := (FFontBidiModeBefore = FFontBidiModeAfter) and (FFontEmHeightBefore = FFontEmHeightAfter) and (FFontNameBefore = FFontNameAfter) and - (FFontStyleBefore = FFontStyleAfter); + (FFontStyleBefore = FFontStyleAfter) and + (FAliasedBefore = FAliasedAfter); end; { TTextShape } @@ -547,6 +558,14 @@ procedure TTextShape.OnMoveLightPos(ASender: TObject; APrevCoord, LightPosition := ANewCoord; end; +procedure TTextShape.SetAliased(AValue: boolean); +begin + if FAliased=AValue then Exit; + BeginUpdate(TTextShapeFontDiff); + FAliased:=AValue; + EndUpdate; +end; + procedure TTextShape.SetAltitudePercent(AValue: single); begin if AValue < 0 then AValue := 0; @@ -960,6 +979,7 @@ constructor TTextShape.Create(AContainer: TVectorOriginal); FPenPhong:= false; FAltitudePercent:= DefaultAltitudePercent; FLightPosition := PointF(0,0); + FAliased := false; end; procedure TTextShape.QuickDefine(constref APoint1, APoint2: TPointF); @@ -1019,6 +1039,8 @@ procedure TTextShape.LoadFromStorage(AStorage: TBGRACustomOriginalStorage); end else SetDefaultFont; + Aliased := AStorage.Bool['aliased']; + phongObj := AStorage.OpenObject('pen-phong'); PenPhong := Assigned(phongObj); if PenPhong then @@ -1064,6 +1086,7 @@ procedure TTextShape.SaveToStorage(AStorage: TBGRACustomOriginalStorage); font.RawString['bidi'] := FontBidiModeToStr(FontBidiMode); font.RawString['style'] := FontStyleToStr(FontStyle); font.Free; + AStorage.Bool['aliased'] := Aliased; if PenPhong then begin @@ -1283,7 +1306,7 @@ procedure TTextShape.Render(ADest: TBGRABitmap; ARenderOffset: TPoint; AMatrix: ctx := tmpTransf.Canvas2D; ctx.transform(AffineMatrixTranslation(-transfRect.Left,-transfRect.Top)*m); ctx.fillMode := fmWinding; - ctx.antialiasing:= not ADraft; + ctx.antialiasing:= not ADraft and not Aliased; ctx.beginPath; tl.PathText(ctx); ctx.resetTransform; @@ -1366,7 +1389,7 @@ procedure TTextShape.Render(ADest: TBGRABitmap; ARenderOffset: TPoint; AMatrix: ADest.PutImage(transfRect.Left, transfRect.Top, tmpTransf, dmDrawWithTransparency); end else begin - if ADraft then rf := rfBox else rf := rfHalfCosine; + if ADraft or Aliased then rf := rfBox else rf := rfHalfCosine; if storeImage then tmpTransf := TBGRABitmap.Create(transfRect.Width,transfRect.Height) else From 6b768b305972691589da931edb19e42d308e9c66 Mon Sep 17 00:00:00 2001 From: johann Date: Tue, 10 Mar 2020 12:22:58 +0100 Subject: [PATCH 08/53] Latvian translation --- lazpaint/release/bin/i18n/lazpaint.lv.po | 881 +++++++++--------- .../release/bin/i18n/lcresourcestring.lv.po | 61 +- 2 files changed, 490 insertions(+), 452 deletions(-) diff --git a/lazpaint/release/bin/i18n/lazpaint.lv.po b/lazpaint/release/bin/i18n/lazpaint.lv.po index cca6d2ac..509d7b93 100644 --- a/lazpaint/release/bin/i18n/lazpaint.lv.po +++ b/lazpaint/release/bin/i18n/lazpaint.lv.po @@ -1,35 +1,38 @@ -# Kārlis Kalviškis , 2015. msgid "" msgstr "" "Project-Id-Version: LazPaint\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-01-20 11:31+0200\n" -"PO-Revision-Date: 2015-04-15 11:16+0300\n" -"Last-Translator: Kārlis Kalviškis \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: 2020-03-09 22:24+0200\n" +"Last-Translator: Kārlis Kalviškis \n" "Language-Team: LJC\n" "Language: lv\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2);\n" -"X-Generator: Virtaal 0.7.1\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : " +"2);\n" +"X-Generator: Poedit 2.2.1\n" "X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-Basepath: ../../..\n" +"X-Poedit-SearchPath-0: debug\n" +"X-Poedit-SearchPath-1: .\n" #: tablet.getprocfailed msgid "Procedure %s failed to load properly." -msgstr "" +msgstr "%s procedūru neizdevās pareizi ielasīt." #: tablet.openfailed msgid "Tablet context failed to open." -msgstr "" +msgstr "Neizdevās atvērt planšeti." #: tfabout.button_donate.caption -msgctxt "TFABOUT.BUTTON_DONATE.CAPTION" +msgctxt "tfabout.button_donate.caption" msgid "Donate..." msgstr "Ziedot ..." #: tfabout.caption -msgctxt "TFABOUT.CAPTION" +msgctxt "tfabout.caption" msgid "About" msgstr "Par LazPaint" @@ -38,42 +41,42 @@ msgid "http://sourceforge.net/projects/lazpaint/" msgstr "http://sourceforge.net/projects/lazpaint/" #: tfabout.label_authors.caption -msgctxt "TFABOUT.LABEL_AUTHORS.CAPTION" +msgctxt "tfabout.label_authors.caption" msgid "Authors:" msgstr "Autori:" #: tfabout.label_authorsvalue.caption -msgctxt "TFABOUT.LABEL_AUTHORSVALUE.CAPTION" +msgctxt "tfabout.label_authorsvalue.caption" msgid "Circular helped by FabienWang, Lainz and others" msgstr "Circular, kuram palīdzēja FabienWang, Lainz un citi" #: tfabout.label_homepage.caption -msgctxt "TFABOUT.LABEL_HOMEPAGE.CAPTION" +msgctxt "tfabout.label_homepage.caption" msgid "Homepage:" msgstr "Mājas lapa:" #: tfabout.label_libraries.caption -msgctxt "TFABOUT.LABEL_LIBRARIES.CAPTION" +msgctxt "tfabout.label_libraries.caption" msgid "Libraries used:" msgstr "Izmantotās bibliotēkas:" #: tfabout.label_licence.caption -msgctxt "TFABOUT.LABEL_LICENCE.CAPTION" +msgctxt "tfabout.label_licence.caption" msgid "Licence:" -msgstr "Licence" +msgstr "Licence:" #: tfabout.label_opensource.caption -msgctxt "TFABOUT.LABEL_OPENSOURCE.CAPTION" +msgctxt "tfabout.label_opensource.caption" msgid "Open source (GPLv3)" -msgstr "Atklātā pirmkoda programmatūra (GPLv3)" +msgstr "Atklātā pirmkoda (GPLv3)" #: tfadjustcurves.button_cancel.caption -msgctxt "TFADJUSTCURVES.BUTTON_CANCEL.CAPTION" +msgctxt "tfadjustcurves.button_cancel.caption" msgid "Cancel" -msgstr "Atsaukt" +msgstr "Atcelt" #: tfadjustcurves.button_ok.caption -msgctxt "TFADJUSTCURVES.BUTTON_OK.CAPTION" +msgctxt "tfadjustcurves.button_ok.caption" msgid "OK" msgstr "Labi" @@ -95,12 +98,12 @@ msgid "Remove selected point (Del)" msgstr "Dzēst izvēlēto punktu (Del)" #: tfblendop.button_cancel.caption -msgctxt "TFBLENDOP.BUTTON_CANCEL.CAPTION" +msgctxt "tfblendop.button_cancel.caption" msgid "Cancel" -msgstr "Atsaukt" +msgstr "Atcelt" #: tfblendop.button_ok.caption -msgctxt "TFBLENDOP.BUTTON_OK.CAPTION" +msgctxt "tfblendop.button_ok.caption" msgid "OK" msgstr "Labi" @@ -109,7 +112,7 @@ msgid "Blend operation" msgstr "Sapludināšana" #: tfblendop.label_blendopcategory.caption -msgctxt "TFBLENDOP.LABEL_BLENDOPCATEGORY.CAPTION" +msgctxt "tfblendop.label_blendopcategory.caption" msgid "Category of blend operation" msgstr "Sapludināšanas veids" @@ -119,7 +122,7 @@ msgid "." msgstr "." #: tfblendop.label_kritaover.caption -msgctxt "TFBLENDOP.LABEL_KRITAOVER.CAPTION" +msgctxt "tfblendop.label_kritaover.caption" msgid "Krita" msgstr "Krita" @@ -128,7 +131,7 @@ msgid "Blend operations that are available in Krita" msgstr "Sapludināšana kāda iespējama programmā Krita" #: tfblendop.label_otherover.caption -msgctxt "TFBLENDOP.LABEL_OTHEROVER.CAPTION" +msgctxt "tfblendop.label_otherover.caption" msgid "Other" msgstr "Cits" @@ -137,7 +140,7 @@ msgid "Blend operations of LazPaint and Paint.NET" msgstr "LazPant un Paint.NET sapludināšanas darbības" #: tfblendop.label_patternover.caption -msgctxt "TFBLENDOP.LABEL_PATTERNOVER.CAPTION" +msgctxt "tfblendop.label_patternover.caption" msgid "Pattern over" msgstr "Raksts pa virsu" @@ -146,7 +149,7 @@ msgid "Preview blend operation with the specified image on top" msgstr "Sapludināsanas priekšapskate ar izvēlēto attēlu augšpusē" #: tfblendop.label_patternunder.caption -msgctxt "TFBLENDOP.LABEL_PATTERNUNDER.CAPTION" +msgctxt "tfblendop.label_patternunder.caption" msgid "Pattern under" msgstr "Raksts apakšā" @@ -155,21 +158,22 @@ msgid "Preview blend operation with the specified image underneath" msgstr "Sapludināsanas priekšapskate ar izvēlēto attēlu apakšpusē" #: tfblendop.label_previewwith.caption -msgctxt "TFBLENDOP.LABEL_PREVIEWWITH.CAPTION" +msgctxt "tfblendop.label_previewwith.caption" msgid "Preview with" msgstr "Priekšskatīt ar" #: tfblendop.label_selectedblendop.caption msgid "Selected blend operation :" -msgstr "Izvēlētā sapludināšana" +msgstr "Izvēlētā sapludināšana:" #: tfblendop.label_svgover.caption -msgctxt "TFBLENDOP.LABEL_SVGOVER.CAPTION" +msgctxt "tfblendop.label_svgover.caption" msgid "Basic SVG" -msgstr "PamatSVG" +msgstr "Pamatveidi" #: tfblendop.label_svgover.hint -msgid "Basic blend operations that are available in virtually all image editors" +msgid "" +"Basic blend operations that are available in virtually all image editors" msgstr "Sapludunāšana veidi, kuri pieejami gandrīz visos attēlu redaktoros" #: tfbrowseimages.caption @@ -178,7 +182,7 @@ msgstr "Caurskatīt attēlus" #: tfbrowseimages.checkbox_usedirectoryonstartup.caption msgid "Use this directory on startup" -msgstr "" +msgstr "Sākotnēji lieto šo direktoriju" #: tfbrowseimages.label_status.caption msgctxt "tfbrowseimages.label_status.caption" @@ -187,7 +191,7 @@ msgstr "." #: tfbrowseimages.toolbutton_createfolderorcontainer.hint msgid "Create folder or container" -msgstr "" +msgstr "Izveido mapi vai resursu datni" #: tfbrowseimages.toolbutton_goup.hint msgid "Go one directory up" @@ -198,14 +202,14 @@ msgid "Open selected files" msgstr "Atvērt izvēlētos failus" #: tfbrowseimages.toolbutton_viewbigicon.hint -msgctxt "TFBROWSEIMAGES.TOOLBUTTON_VIEWBIGICON.HINT" +msgctxt "tfbrowseimages.toolbutton_viewbigicon.hint" msgid "Show big icons" -msgstr "Rādīt lielas ikonas" +msgstr "Skatīt kā lielas ikonas" #: tfbrowseimages.toolbutton_viewdetails.hint -msgctxt "TFBROWSEIMAGES.TOOLBUTTON_VIEWDETAILS.HINT" +msgctxt "tfbrowseimages.toolbutton_viewdetails.hint" msgid "Show details and preview" -msgstr "Ziņas un priekšapskate" +msgstr "Skatīt kā detalizētu sarakstu" #: tfbrowseimages.tool_selectdrive.hint msgid "Select drive" @@ -214,7 +218,7 @@ msgstr "Izvēlies disku" #: tfcanvassize.button_cancel.caption msgctxt "TFCANVASSIZE.BUTTON_CANCEL.CAPTION" msgid "Cancel" -msgstr "Atsaukt" +msgstr "Atcelt" #: tfcanvassize.button_ok.caption msgctxt "TFCANVASSIZE.BUTTON_OK.CAPTION" @@ -222,7 +226,7 @@ msgid "OK" msgstr "Labi" #: tfcanvassize.caption -msgctxt "TFCANVASSIZE.CAPTION" +msgctxt "tfcanvassize.caption" msgid "Canvas size" msgstr "Audekla izmērs" @@ -231,17 +235,17 @@ msgid "Flip mode" msgstr "Spoguļot" #: tfcanvassize.label_anchor.caption -msgctxt "TFCANVASSIZE.LABEL_ANCHOR.CAPTION" +msgctxt "tfcanvassize.label_anchor.caption" msgid "Anchor :" msgstr "Slāņa novietojums:" #: tfcanvassize.label_height.caption -msgctxt "TFCANVASSIZE.LABEL_HEIGHT.CAPTION" +msgctxt "tfcanvassize.label_height.caption" msgid "Height :" msgstr "Augstums:" #: tfcanvassize.label_width.caption -msgctxt "TFCANVASSIZE.LABEL_WIDTH.CAPTION" +msgctxt "tfcanvassize.label_width.caption" msgid "Width :" msgstr "Platums:" @@ -254,18 +258,22 @@ msgid "Remove color from palette" msgstr "Izņemt krāsu no paletes" #: tfchoosecolor.caption -msgctxt "TFCHOOSECOLOR.CAPTION" +msgctxt "tfchoosecolor.caption" msgid "Color" msgstr "Krāsa" #: tfchoosecolor.lcolor.hint -msgid "Color description: click to type in a color with the keyboard using color names or CSS notation." -msgstr "Krāsas apraksts: ieklikškini, lai ierakstītu krāsas vārdu angliski vai CSS pierakstā." +msgid "" +"Color description: click to type in a color with the keyboard using color " +"names or CSS notation." +msgstr "" +"Krāsas apraksts: ieklikškini, lai ierakstītu krāsas vārdu angliski vai CSS " +"pierakstā." #: tfcolorintensity.button_cancel.caption msgctxt "TFCOLORINTENSITY.BUTTON_CANCEL.CAPTION" msgid "Cancel" -msgstr "Atsaukt" +msgstr "Atcelt" #: tfcolorintensity.button_ok.caption msgctxt "TFCOLORINTENSITY.BUTTON_OK.CAPTION" @@ -273,24 +281,24 @@ msgid "OK" msgstr "Labi" #: tfcolorintensity.caption -msgctxt "TFCOLORINTENSITY.CAPTION" +msgctxt "tfcolorintensity.caption" msgid "Intensity" msgstr "Spilgtums" #: tfcolorintensity.label_multiply.caption -msgctxt "TFCOLORINTENSITY.LABEL_MULTIPLY.CAPTION" +msgctxt "tfcolorintensity.label_multiply.caption" msgid "Multiply" msgstr "Reizinātājs" #: tfcolorintensity.label_shift.caption -msgctxt "TFCOLORINTENSITY.LABEL_SHIFT.CAPTION" +msgctxt "tfcolorintensity.label_shift.caption" msgid "Shift" -msgstr "Novirze" +msgstr "Nobīde" #: tfcolorize.button_cancel.caption msgctxt "TFCOLORIZE.BUTTON_CANCEL.CAPTION" msgid "Cancel" -msgstr "Atsaukt" +msgstr "Atcelt" #: tfcolorize.button_ok.caption msgctxt "TFCOLORIZE.BUTTON_OK.CAPTION" @@ -298,22 +306,22 @@ msgid "OK" msgstr "Labi" #: tfcolorize.caption -msgctxt "TFCOLORIZE.CAPTION" +msgctxt "tfcolorize.caption" msgid "Colorize" msgstr "Iekrāsot" #: tfcolorize.checkbox_gsba.caption -msgctxt "TFCOLORIZE.CHECKBOX_GSBA.CAPTION" +msgctxt "tfcolorize.checkbox_gsba.caption" msgid "Corrected hue and lightness" msgstr "Izlabot nokrāsu un gaišumu" #: tfcolorize.label_colorness.caption -msgctxt "TFCOLORIZE.LABEL_COLORNESS.CAPTION" +msgctxt "tfcolorize.label_colorness.caption" msgid "Colorness" msgstr "Piesātinājums" #: tfcolorize.label_hue.caption -msgctxt "TFCOLORIZE.LABEL_HUE.CAPTION" +msgctxt "tfcolorize.label_hue.caption" msgid "Hue" msgstr "Nokrāsa" @@ -324,7 +332,7 @@ msgstr "Iestatījumi" #: tfcustomblur.button_cancel.caption msgctxt "TFCUSTOMBLUR.BUTTON_CANCEL.CAPTION" msgid "Cancel" -msgstr "Atsaukt" +msgstr "Atcelt" #: tfcustomblur.button_editmask.caption msgid "Edit mask..." @@ -340,9 +348,9 @@ msgid "OK" msgstr "Labi" #: tfcustomblur.caption -msgctxt "TFCUSTOMBLUR.CAPTION" +msgctxt "tfcustomblur.caption" msgid "Custom blur" -msgstr "Pielāgota aizmiglošana" +msgstr "Pielāgota izpludināšana" #: tfcustomblur.openpicturedialog1.title msgid "Open grayscale file" @@ -351,7 +359,7 @@ msgstr "Atvērt pelēktoņu attēlu" #: tfemboss.button_cancel.caption msgctxt "TFEMBOSS.BUTTON_CANCEL.CAPTION" msgid "Cancel" -msgstr "Atsaukt" +msgstr "Atcelt" #: tfemboss.button_ok.caption msgctxt "TFEMBOSS.BUTTON_OK.CAPTION" @@ -359,30 +367,30 @@ msgid "OK" msgstr "Labi" #: tfemboss.caption -msgctxt "TFEMBOSS.CAPTION" +msgctxt "tfemboss.caption" msgid "Emboss" msgstr "Gofrēt" #: tfemboss.checkbox_preservecolors.caption msgid "Preserve colors" -msgstr "" +msgstr "Saglabāt krāsas" #: tfemboss.checkbox_transparent.caption msgid "Transparent" -msgstr "" +msgstr "Caurspīdīgs" #: tfemboss.label_direction.caption -msgctxt "TFEMBOSS.LABEL_DIRECTION.CAPTION" +msgctxt "tfemboss.label_direction.caption" msgid "Direction :" msgstr "Virziens:" #: tffilterfunction.button_cancel.caption -msgctxt "TFFILTERFUNCTION.BUTTON_CANCEL.CAPTION" +msgctxt "tffilterfunction.button_cancel.caption" msgid "Cancel" -msgstr "Atsaukt" +msgstr "Atcelt" #: tffilterfunction.button_ok.caption -msgctxt "TFFILTERFUNCTION.BUTTON_OK.CAPTION" +msgctxt "tffilterfunction.button_ok.caption" msgid "OK" msgstr "Labi" @@ -392,12 +400,12 @@ msgstr "Pielietot funkciju" #: tffilterfunction.checkbox_gamma.caption msgid "Gamma correction" -msgstr "" +msgstr "Gaišuma izmaiņa" #: tffilterfunction.checkbox_gsba.caption -msgctxt "TFFILTERFUNCTION.CHECKBOX_GSBA.CAPTION" +msgctxt "tffilterfunction.checkbox_gsba.caption" msgid "Corrected hue and lightness" -msgstr "Izlabota nokrāsa un gaišums" +msgstr "Izlabot nokrāsu un gaišumu" #: tffilterfunction.label_alphaequals.caption msgctxt "tffilterfunction.label_alphaequals.caption" @@ -450,7 +458,7 @@ msgstr "RGB" #: tfgeometricbrush.button_cancel.caption msgctxt "tfgeometricbrush.button_cancel.caption" msgid "Cancel" -msgstr "Atsaukt" +msgstr "Atcelt" #: tfgeometricbrush.button_ok.caption msgctxt "tfgeometricbrush.button_ok.caption" @@ -467,7 +475,7 @@ msgstr "Izgaišana uz malām" #: tfgeometricbrush.label1.caption msgid "Number of sides:" -msgstr "Malu skaits" +msgstr "Malu skaits:" #: tfimagelist.caption msgid "Image List" @@ -503,17 +511,17 @@ msgid "-" msgstr "-" #: tfimagelist.stringgrid1.columns[1].title.caption -msgctxt "TFIMAGELIST.STRINGGRID1.COLUMNS[1].TITLE.CAPTION" +msgctxt "tfimagelist.stringgrid1.columns[1].title.caption" msgid "-" msgstr "-" #: tfimagelist.stringgrid1.columns[2].title.caption -msgctxt "TFIMAGELIST.STRINGGRID1.COLUMNS[2].TITLE.CAPTION" +msgctxt "tfimagelist.stringgrid1.columns[2].title.caption" msgid "-" msgstr "-" #: tfimagelist.stringgrid1.columns[3].title.caption -msgctxt "TFIMAGELIST.STRINGGRID1.COLUMNS[3].TITLE.CAPTION" +msgctxt "tfimagelist.stringgrid1.columns[3].title.caption" msgid "-" msgstr "-" @@ -559,7 +567,7 @@ msgid "Open next image (Alt-Right)" msgstr "Atvērt sarakstā esošo nākamo attēlu (Alt-Pa_labi)" #: tfimagelist.tbopennextsw.hint -msgctxt "TFIMAGELIST.TBOPENNEXTSW.HINT" +msgctxt "tfimagelist.tbopennextsw.hint" msgid "Open next image" msgstr "Atvērt nākamo attēlu" @@ -569,7 +577,7 @@ msgid "Open previous image (Alt-Left)" msgstr "Atvērt sarakstā esošo iepriekšējo attēlu (Alt-Pa_kreisi)" #: tfimagelist.tbopenprevsw.hint -msgctxt "TFIMAGELIST.TBOPENPREVSW.HINT" +msgctxt "tfimagelist.tbopenprevsw.hint" msgid "Open previous image" msgstr "Atvērt iepriekšējo attēlu" @@ -582,7 +590,7 @@ msgid "Uncheck all files for processing" msgstr "Noņemt visus ķekšus" #: tflayerstack.caption -msgctxt "TFLAYERSTACK.CAPTION" +msgctxt "tflayerstack.caption" msgid "Layers" msgstr "Slāņi" @@ -621,7 +629,7 @@ msgid "Remove current brush" msgstr "Izmest doto otu" #: tfmain.caption -msgctxt "TFMAIN.CAPTION" +msgctxt "tfmain.caption" msgid "LazPaint" msgstr "LazPaint" @@ -650,13 +658,13 @@ msgid "Posterize..." msgstr "Plakāta efekts ..." #: tfmain.colorshiftcolors.caption -msgctxt "TFMAIN.COLORSHIFTCOLORS.CAPTION" +msgctxt "tfmain.colorshiftcolors.caption" msgid "Shift colors..." msgstr "Nobīdīt krāsas ..." #: tfmain.combobox_penstyle.hint msgid "Pen style" -msgstr "" +msgstr "Līnijas veids" #: tfmain.editcopy.caption msgid "Copy" @@ -695,19 +703,19 @@ msgstr "Iezīmēt otrādi" #: tfmain.editmovedown.hint msgid "Move down" -msgstr "" +msgstr "Lejup" #: tfmain.editmovetoback.hint msgid "Send to back" -msgstr "" +msgstr "Novietot apakšā" #: tfmain.editmovetofront.hint msgid "Bring to front" -msgstr "" +msgstr "Novietot priekšpusē" #: tfmain.editmoveup.hint msgid "Move up" -msgstr "" +msgstr "Augšup" #: tfmain.editpaste.hint msgctxt "TFMAIN.EDITPASTE.HINT" @@ -725,7 +733,7 @@ msgstr "Ievietot kā jaunu slāni" #: tfmain.editredo.hint msgctxt "TFMAIN.EDITREDO.HINT" msgid "Redo" -msgstr "Pārdarīt" +msgstr "Atjaunot atsaukto" #: tfmain.editselectall.caption msgctxt "tfmain.editselectall.caption" @@ -733,7 +741,6 @@ msgid "Select all" msgstr "Iezīmēt visu" #: tfmain.editselectall.hint -#, fuzzy msgctxt "tfmain.editselectall.hint" msgid "Select all" msgstr "Iezīmēt visu" @@ -748,31 +755,31 @@ msgstr "Ievietot iezīmējumā" #: tfmain.editshapealignbottom.hint msgid "Align shape to the bottom" -msgstr "" +msgstr "Līdzināt pēc apakšmalas" #: tfmain.editshapealignleft.hint msgid "Align shape left" -msgstr "" +msgstr "Līdzināt pēc kreisās malas" #: tfmain.editshapealignright.hint msgid "Align shape right" -msgstr "" +msgstr "Līdzināt pēc labās malas" #: tfmain.editshapealigntop.hint msgid "Align shape to the top" -msgstr "" +msgstr "Līdzināt pēc augšmalas" #: tfmain.editshapecenterhorizontally.hint msgid "Center shape horizontally" -msgstr "" +msgstr "Līdzināt pēc stateniskā vidus" #: tfmain.editshapecentervertically.hint msgid "Center shape vertically" -msgstr "" +msgstr "Līdzināt pēc guleniskā vidus" #: tfmain.editshapetocurve.hint msgid "Convert shape to curve" -msgstr "" +msgstr "Pārveidot daudzstūri par līniju" #: tfmain.editundo.caption msgid "Undo" @@ -785,11 +792,11 @@ msgstr "Atsauc pēdējās izmaiņas" #: tfmain.embeddedcancel.caption msgctxt "TFMAIN.EMBEDDEDCANCEL.CAPTION" msgid "Cancel" -msgstr "Atsaukt" +msgstr "Atcelt" #: tfmain.embeddedcancel.hint msgid "Cancel modifications" -msgstr "Pārtrauc neko neizmainot" +msgstr "Atcelt izmaiņas" #: tfmain.embeddedvalidate.caption msgid "Validate" @@ -801,19 +808,19 @@ msgstr "Pārbaudīt izmaiņas" #: tfmain.exportpicturedialog.title msgid "Export as..." -msgstr "" +msgstr "Eksportēt kā ..." #: tfmain.filechooseentry.caption msgid "Choose entry..." -msgstr "" +msgstr "Ielasi citu daļu ..." #: tfmain.filechooseentry.hint msgid "Choose entry within file" -msgstr "" +msgstr "Ielasa citu attēla daļu, piemēram, animēta GIF kadru" #: tfmain.fileexport.caption msgid "Export..." -msgstr "" +msgstr "Eksportēt ..." #: tfmain.fileimport3d.caption msgid "Import 3D object..." @@ -850,17 +857,17 @@ msgid "Quit" msgstr "Iziet" #: tfmain.filereload.caption -msgctxt "TFMAIN.FILERELOAD.CAPTION" +msgctxt "tfmain.filereload.caption" msgid "Reload" -msgstr "Pārlasīt attēlu" +msgstr "Ielasīt no jauna" #: tfmain.fileremembersaveformat.hint msgid "Remember save format" -msgstr "" +msgstr "Atcerēties izmantotos failu formātus" #: tfmain.filerunscript.caption msgid "Run script..." -msgstr "" +msgstr "Darbināt skriptu ..." #: tfmain.filesave.caption msgctxt "TFMAIN.FILESAVE.CAPTION" @@ -891,46 +898,46 @@ msgstr "Saglabāt iezīmējumu kā ..." #: tfmain.fileuseimagebrowser.caption msgctxt "tfmain.fileuseimagebrowser.caption" msgid "Use image browser" -msgstr "" +msgstr "Lietot attēlu pārlūku" #: tfmain.filterblurbox.caption msgid "Box blur..." -msgstr "" +msgstr "Kantaina izpludināšana ..." #: tfmain.filterblurcorona.caption -msgctxt "TFMAIN.FILTERBLURCORONA.CAPTION" +msgctxt "tfmain.filterblurcorona.caption" msgid "Corona blur..." msgstr "Aurveida izpludināšana ..." #: tfmain.filterblurcustom.caption -msgctxt "TFMAIN.FILTERBLURCUSTOM.CAPTION" +msgctxt "tfmain.filterblurcustom.caption" msgid "Custom blur..." msgstr "Pielāgota izpludināšana ..." #: tfmain.filterblurdisk.caption -msgctxt "TFMAIN.FILTERBLURDISK.CAPTION" +msgctxt "tfmain.filterblurdisk.caption" msgid "Disk blur..." -msgstr "" +msgstr "Noapaļota izpludināšana ..." #: tfmain.filterblurfast.caption -msgctxt "TFMAIN.FILTERBLURFAST.CAPTION" +msgctxt "tfmain.filterblurfast.caption" msgid "Fast blur..." msgstr "Ātrā izpludināšana ..." #: tfmain.filterblurmotion.caption -msgctxt "TFMAIN.FILTERBLURMOTION.CAPTION" +msgctxt "tfmain.filterblurmotion.caption" msgid "Motion blur..." -msgstr "Kusības izplūdums ..." +msgstr "Kustības izplūdums ..." #: tfmain.filterblurprecise.caption -msgctxt "TFMAIN.FILTERBLURPRECISE.CAPTION" +msgctxt "tfmain.filterblurprecise.caption" msgid "Precise blur..." -msgstr "" +msgstr "Uzdota izpludināšana ..." #: tfmain.filterblurradial.caption -msgctxt "TFMAIN.FILTERBLURRADIAL.CAPTION" +msgctxt "tfmain.filterblurradial.caption" msgid "Gaussian blur..." -msgstr "Vienmērīga izpludināšana ..." +msgstr "Izpludināšana pēc Gausa ..." #: tfmain.filtercleartype.caption msgid "ClearType" @@ -954,7 +961,7 @@ msgstr "Cilindrs" #: tfmain.filteremboss.caption msgid "Emboss..." -msgstr "Iegravēts" +msgstr "Iegravēts..." #: tfmain.filterfunction.caption msgid "Apply function..." @@ -965,9 +972,9 @@ msgid "Grayscale" msgstr "Pelēko toņu" #: tfmain.filterlinearnegative.caption -msgctxt "TFMAIN.FILTERLINEARNEGATIVE.CAPTION" +msgctxt "tfmain.filterlinearnegative.caption" msgid "Linear negative" -msgstr "Tiešs negatīvs" +msgstr "Izlīdzināts negatīvs" #: tfmain.filtermedian.caption msgid "Median" @@ -1022,15 +1029,15 @@ msgstr "Savirpināt ..." #: tfmain.filterwavedisplacement.caption msgid "Wave displacement..." -msgstr "" +msgstr "Viļņi ..." #: tfmain.forgetdialoganswers.caption msgid "Forget dialog box answers" -msgstr "" +msgstr "Aizmirst atbildes" #: tfmain.forgetdialoganswers.hint msgid "Forget answers given to dialog boxes" -msgstr "" +msgstr "Aizmirst atbildes, kura tika ierakstītas dialoglogos" #: tfmain.helpabout.caption msgid "About..." @@ -1042,7 +1049,7 @@ msgstr "Saraksts ..." #: tfmain.imagechangecanvassize.caption msgid "Canvas size..." -msgstr "Audekla izmērs" +msgstr "Audekla izmērs..." #: tfmain.imageclearalpha.caption msgid "Clear alpha channel and set background" @@ -1110,7 +1117,7 @@ msgstr "Palielināt attēlu trīskārtīgi" #: tfmain.imageswapredblue.caption msgid "Swap red and blue channels" -msgstr "" +msgstr "Samainīt sarkano ar zilo kanālu" #: tfmain.imageverticalflip.caption msgctxt "tfmain.imageverticalflip.caption" @@ -1127,16 +1134,16 @@ msgid "Selected tool" msgstr "Izvēlētais rīks" #: tfmain.image_swapcolors.hint -msgctxt "TFMAIN.IMAGE_SWAPCOLORS.HINT" +msgctxt "tfmain.image_swapcolors.hint" msgid "Switch color" -msgstr "Apmainīt krāsas vietām" +msgstr "Samainīt krāsas" #: tfmain.itemdocklayersandcolors.caption msgid "Dock layers and colors" -msgstr "Piesaistīt slāņus un krāsas" +msgstr "Piesaistīt slāņu un krāsu logus" #: tfmain.itemdonate.caption -msgctxt "TFMAIN.ITEMDONATE.CAPTION" +msgctxt "tfmain.itemdonate.caption" msgid "Donate..." msgstr "Ziedot ..." @@ -1147,7 +1154,7 @@ msgstr "Pilnekrāna" #: tfmain.itemuseimagebrowser.caption msgctxt "tfmain.itemuseimagebrowser.caption" msgid "Use image browser" -msgstr "" +msgstr "Lietot attēlu pārlūku" #: tfmain.itemviewdocktoolbox.caption msgid "Dock toolbox" @@ -1159,7 +1166,7 @@ msgstr "Augstums" #: tfmain.label_back.caption msgid "Back" -msgstr "Pamatne" +msgstr "Pildījums" #: tfmain.label_brush.caption msgctxt "tfmain.label_brush.caption" @@ -1167,8 +1174,6 @@ msgid "Brush" msgstr "Ota" #: tfmain.label_coordinates.caption -#, fuzzy -#| msgid "99999x99999" msgid "9999x9999" msgstr "99999x99999" @@ -1200,7 +1205,7 @@ msgid "Curve" msgstr "Līkne" #: tfmain.label_eraser.caption -msgctxt "TFMAIN.LABEL_ERASER.CAPTION" +msgctxt "tfmain.label_eraser.caption" msgid "Erase" msgstr "Dzēst" @@ -1210,33 +1215,33 @@ msgid "Grid" msgstr "Tīkls" #: tfmain.label_gridx.caption -msgctxt "TFMAIN.LABEL_GRIDX.CAPTION" +msgctxt "tfmain.label_gridx.caption" msgid "x" msgstr "x" #: tfmain.label_outlinewidth.caption -msgctxt "TFMAIN.LABEL_OUTLINEWIDTH.CAPTION" +msgctxt "tfmain.label_outlinewidth.caption" msgid "Width" msgstr "Platums" #: tfmain.label_pen.caption msgctxt "TFMAIN.LABEL_PEN.CAPTION" msgid "Pen" -msgstr "Spalva" +msgstr "Līnija" #: tfmain.label_penwidth.caption -msgctxt "TFMAIN.LABEL_PENWIDTH.CAPTION" +msgctxt "tfmain.label_penwidth.caption" msgid "Width" msgstr "Platums" #: tfmain.label_phongborder.caption -msgctxt "TFMAIN.LABEL_PHONGBORDER.CAPTION" +msgctxt "tfmain.label_phongborder.caption" msgid "Border" -msgstr "" +msgstr "Apmale" #: tfmain.label_ratio.caption msgid "Ratio" -msgstr "" +msgstr "Attiecība" #: tfmain.label_shadowoffset.caption msgctxt "TFMAIN.LABEL_SHADOWOFFSET.CAPTION" @@ -1263,7 +1268,7 @@ msgid "Blur" msgstr "Izsmērēt" #: tfmain.label_tolerance.caption -msgctxt "TFMAIN.LABEL_TOLERANCE.CAPTION" +msgctxt "tfmain.label_tolerance.caption" msgid "Tolerance" msgstr "Pielaide" @@ -1278,53 +1283,53 @@ msgid "Duplicate selected layer" msgstr "Izveidot dotā slāņa kopiju" #: tfmain.layerfromfile.hint -msgctxt "TFMAIN.LAYERFROMFILE.HINT" +msgctxt "tfmain.layerfromfile.hint" msgid "Import layer from file..." msgstr "Ielasi slāni no datnes ..." #: tfmain.layerhorizontalflip.hint msgid "Flip layer horizontally" -msgstr "Apmest slāni guleniski" +msgstr "Apmest slāni stateniski" #: tfmain.layermergeover.hint -msgctxt "TFMAIN.LAYERMERGEOVER.HINT" +msgctxt "tfmain.layermergeover.hint" msgid "Merge layer over" msgstr "Apvienot ar apakšējo slāni" #: tfmain.layermove.hint -msgctxt "TFMAIN.LAYERMOVE.HINT" +msgctxt "tfmain.layermove.hint" msgid "Move layer" msgstr "Pārvietot slāni" #: tfmain.layerrasterize.hint msgid "Rasterize layer" -msgstr "" +msgstr "Pārvērst par rastru" #: tfmain.layerremovecurrent.hint -msgctxt "TFMAIN.LAYERREMOVECURRENT.HINT" +msgctxt "tfmain.layerremovecurrent.hint" msgid "Remove layer" msgstr "Izdzēst slāni" #: tfmain.layerrotate.hint -msgctxt "TFMAIN.LAYERROTATE.HINT" +msgctxt "tfmain.layerrotate.hint" msgid "Rotate layer" msgstr "Pagriezt slāni" #: tfmain.layerverticalflip.hint msgctxt "tfmain.layerverticalflip.hint" msgid "Flip layer vertically" -msgstr "Apmesrt slāni stateniski" +msgstr "Apmest slāni guleniski" #: tfmain.layerzoom.hint msgid "Zoom layer" -msgstr "" +msgstr "Pietuvināt slāni" #: tfmain.loadselectiondialog.title msgid "Load selection" msgstr "Ielasīt iezīmējumu" #: tfmain.menucolors.caption -msgctxt "TFMAIN.MENUCOLORS.CAPTION" +msgctxt "tfmain.menucolors.caption" msgid "Colors" msgstr "Krāsas" @@ -1345,7 +1350,7 @@ msgid "Dock right" msgstr "Piesaistīt labā pusē" #: tfmain.menuedit.caption -msgctxt "TFMAIN.MENUEDIT.CAPTION" +msgctxt "tfmain.menuedit.caption" msgid "Edit" msgstr "Labot" @@ -1355,55 +1360,55 @@ msgstr "Datne" #: tfmain.menufiletoolbar.caption msgid "Show file toolbar" -msgstr "" +msgstr "Rādīt datņu rīkjoslu" #: tfmain.menufilter.caption -msgctxt "TFMAIN.MENUFILTER.CAPTION" +msgctxt "tfmain.menufilter.caption" msgid "Filter" msgstr "Filtri" #: tfmain.menuhelp.caption -msgctxt "TFMAIN.MENUHELP.CAPTION" +msgctxt "tfmain.menuhelp.caption" msgid "Help" msgstr "Palīgs" #: tfmain.menuimage.caption -msgctxt "TFMAIN.MENUIMAGE.CAPTION" +msgctxt "tfmain.menuimage.caption" msgid "Image" msgstr "Attēls" #: tfmain.menulanguage.caption -msgctxt "TFMAIN.MENULANGUAGE.CAPTION" +msgctxt "tfmain.menulanguage.caption" msgid "Language" msgstr "Valoda" #: tfmain.menuradialblur.caption -msgctxt "TFMAIN.MENURADIALBLUR.CAPTION" +msgctxt "tfmain.menuradialblur.caption" msgid "Radial blur" msgstr "Vienmērīga izpludināšana" #: tfmain.menurecentfiles.caption -msgctxt "TFMAIN.MENURECENTFILES.CAPTION" +msgctxt "tfmain.menurecentfiles.caption" msgid "Recent files" msgstr "Nesen lietotās datnes" #: tfmain.menuremovetransparency.caption -msgctxt "TFMAIN.MENUREMOVETRANSPARENCY.CAPTION" +msgctxt "tfmain.menuremovetransparency.caption" msgid "Remove transparency" msgstr "Noņemt caurspīdīgumu" #: tfmain.menurender.caption -msgctxt "TFMAIN.MENURENDER.CAPTION" +msgctxt "tfmain.menurender.caption" msgid "Render" msgstr "Atveidot" #: tfmain.menuscript.caption msgctxt "tfmain.menuscript.caption" msgid "Script" -msgstr "" +msgstr "Skripts" #: tfmain.menuselect.caption -msgctxt "TFMAIN.MENUSELECT.CAPTION" +msgctxt "tfmain.menuselect.caption" msgid "Select" msgstr "Iezīmējums" @@ -1413,7 +1418,7 @@ msgid "Show palette" msgstr "Rādīt paleti" #: tfmain.menutool.caption -msgctxt "TFMAIN.MENUTOOL.CAPTION" +msgctxt "tfmain.menutool.caption" msgid "Tools" msgstr "Rīki" @@ -1426,7 +1431,7 @@ msgid "Show undo/redo toolbar" msgstr "Rādīt atsaukšanas rīkus" #: tfmain.menuview.caption -msgctxt "TFMAIN.MENUVIEW.CAPTION" +msgctxt "tfmain.menuview.caption" msgid "View" msgstr "Skats" @@ -1435,7 +1440,7 @@ msgid "Show zoom toolbar" msgstr "Rādīt tuvinājuma rīkus" #: tfmain.open3dobjectdialog.title -msgctxt "TFMAIN.OPEN3DOBJECTDIALOG.TITLE" +msgctxt "tfmain.open3dobjectdialog.title" msgid "Import 3D object" msgstr "Ielasīt 3D veidojumu" @@ -1444,6 +1449,7 @@ msgid "Open brush" msgstr "Atvērt otu" #: tfmain.openpicturedialog1.title +msgctxt "TFMAIN.OPENPICTUREDIALOG1.TITLE" msgid "Open existing image" msgstr "Atvērt esošu attēlu" @@ -1453,14 +1459,14 @@ msgid "Open texture" msgstr "Atvērt virsmas rakstu" #: tfmain.perspective_repeat.hint -msgctxt "TFMAIN.PERSPECTIVE_REPEAT.HINT" +msgctxt "tfmain.perspective_repeat.hint" msgid "Repeat image" msgstr "Veido lielāku attēlu atkārtojot esošo" #: tfmain.perspective_twoplanes.hint -msgctxt "TFMAIN.PERSPECTIVE_TWOPLANES.HINT" +msgctxt "tfmain.perspective_twoplanes.hint" msgid "Draw opposite plane too" -msgstr "" +msgstr "Zīmēt arī spoguļattēlu" #: tfmain.rendercamouflage.caption msgid "Camouflage" @@ -1475,7 +1481,7 @@ msgid "Water with custom colors" msgstr "Ūdens ar izvēlētām krāsām" #: tfmain.rendercyclicperlinnoise.caption -msgctxt "TFMAIN.RENDERCYCLICPERLINNOISE.CAPTION" +msgctxt "tfmain.rendercyclicperlinnoise.caption" msgid "Cyclic Perlin noise" msgstr "Perlina troksnis flīzēm" @@ -1508,7 +1514,7 @@ msgid "Stone" msgstr "Raupjš akmens" #: tfmain.renderwater.caption -msgctxt "TFMAIN.RENDERWATER.CAPTION" +msgctxt "tfmain.renderwater.caption" msgid "Water" msgstr "Ūdens" @@ -1522,7 +1528,7 @@ msgstr "Koksne gargriezumā" #: tfmain.savepicturedialog1.title msgid "Save file as..." -msgstr "Saglabāt failu kā" +msgstr "Saglabāt failu kā..." #: tfmain.saveselectiondialog.title msgctxt "TFMAIN.SAVESELECTIONDIALOG.TITLE" @@ -1531,21 +1537,21 @@ msgstr "Saglabāt iezīmējumu kā ..." #: tfmain.selectionhorizontalflip.hint msgid "Flip selection horizontally" -msgstr "" +msgstr "Apmest iezīmējumu stateniski" #: tfmain.selectionverticalflip.hint msgid "Flip selection vertically" -msgstr "" +msgstr "Apmest iezīmējumu guleniski" #: tfmain.spinedit_arrowsizex.hint msgctxt "tfmain.spinedit_arrowsizex.hint" msgid "Horizontal size of the arrow" -msgstr "" +msgstr "Bultas garums" #: tfmain.spinedit_arrowsizey.hint msgctxt "tfmain.spinedit_arrowsizey.hint" msgid "Vertical size of the arrow" -msgstr "" +msgstr "Bultas platums" #: tfmain.spinedit_brushspacing.hint msgctxt "tfmain.spinedit_brushspacing.hint" @@ -1560,7 +1566,7 @@ msgstr "Dzēšgumijas caurredzamība" #: tfmain.spinedit_penwidth.hint msgctxt "tfmain.spinedit_penwidth.hint" msgid "Pen width" -msgstr "Otas platums" +msgstr "Līnijas platums" #: tfmain.spinedit_phongbordersize.hint msgctxt "tfmain.spinedit_phongbordersize.hint" @@ -1570,7 +1576,7 @@ msgstr "Apmales platums" #: tfmain.spinedit_shapealtitude.hint msgctxt "tfmain.spinedit_shapealtitude.hint" msgid "Shape altitude" -msgstr "" +msgstr "Figūras biezums" #: tfmain.spinedit_textblur.hint msgctxt "tfmain.spinedit_textblur.hint" @@ -1585,17 +1591,17 @@ msgstr "Apmales platums" #: tfmain.spinedit_textshadowx.hint msgctxt "tfmain.spinedit_textshadowx.hint" msgid "Horizontal shadow offset" -msgstr "" +msgstr "Ēnas nobīde uz sāniem" #: tfmain.spinedit_textshadowy.hint msgctxt "tfmain.spinedit_textshadowy.hint" msgid "Vertical shadow offset" -msgstr "" +msgstr "Stateniskā ēnas nobīde" #: tfmain.spinedit_textsize.hint msgctxt "tfmain.spinedit_textsize.hint" msgid "Text size" -msgstr "" +msgstr "Teksta izmērs" #: tfmain.toolbrush.hint msgctxt "tfmain.toolbrush.hint" @@ -1603,6 +1609,7 @@ msgid "Brush" msgstr "Ota" #: tfmain.toolchangedocking.hint +msgctxt "tfmain.toolchangedocking.hint" msgid "Change docking" msgstr "Manīt rīku novietojumu" @@ -1625,7 +1632,7 @@ msgstr "Staipīšanas režģis" #: tfmain.tooleditshape.hint msgid "Edit shape" -msgstr "" +msgstr "Labot vienumu" #: tfmain.toolellipse.hint msgctxt "TFMAIN.TOOLELLIPSE.HINT" @@ -1667,9 +1674,9 @@ msgid "Choose hot spot of a cursor" msgstr "" #: tfmain.toollayermapping.hint -msgctxt "TFMAIN.TOOLLAYERMAPPING.HINT" +msgctxt "tfmain.toollayermapping.hint" msgid "Layer perspective" -msgstr "" +msgstr "Slāņa perspektīva" #: tfmain.toolmagicwand.caption msgid "Magic wand" @@ -1686,7 +1693,7 @@ msgstr "Pārvietot iezīmējumu" #: tfmain.toolopenedcurve.hint msgid "Opened curve" -msgstr "" +msgstr "Liekta līnija" #: tfmain.toolpen.caption msgctxt "TFMAIN.TOOLPEN.CAPTION" @@ -1700,7 +1707,7 @@ msgstr "Parasta rakstāmspalva" #: tfmain.toolphong.hint msgctxt "TFMAIN.TOOLPHONG.HINT" msgid "Shaded shape" -msgstr "Daudzstūris ar ēnu" +msgstr "Figūra ar ēnu" #: tfmain.toolpolygon.caption msgid "Polygon" @@ -1712,7 +1719,7 @@ msgstr "Daudzstūris vai lauzta līnija" #: tfmain.toolpolyline.hint msgid "Polyline" -msgstr "" +msgstr "Lauzta līnija" #: tfmain.toolrect.hint msgctxt "TFMAIN.TOOLRECT.HINT" @@ -1730,12 +1737,12 @@ msgid "Select ellipse" msgstr "Iezīmēšanas elipse" #: tfmain.toolselectpen.caption -msgctxt "TFMAIN.TOOLSELECTPEN.CAPTION" +msgctxt "tfmain.toolselectpen.caption" msgid "Selection pen" msgstr "Iezīmēšanas ota" #: tfmain.toolselectpen.hint -msgctxt "TFMAIN.TOOLSELECTPEN.HINT" +msgctxt "tfmain.toolselectpen.hint" msgid "Draw selection with pen" msgstr "Iezīmēt attēla daļas ar otu" @@ -1750,7 +1757,7 @@ msgid "Select rectangle" msgstr "Iezīmēšanas taisnstūris" #: tfmain.toolselectspline.hint -msgctxt "TFMAIN.TOOLSELECTSPLINE.HINT" +msgctxt "tfmain.toolselectspline.hint" msgid "Select curve" msgstr "Iezīmēšanas līknes" @@ -1760,7 +1767,6 @@ msgid "Curve" msgstr "Līknes" #: tfmain.toolspline.hint -#, fuzzy msgctxt "tfmain.toolspline.hint" msgid "Curve" msgstr "Līknes" @@ -1777,7 +1783,7 @@ msgstr "Virsma ar rakstu" #: tfmain.tool_aliasing.hint msgid "Disable antialiasing" -msgstr "" +msgstr "Izslēgt krāsu nogludināšanu" #: tfmain.tool_capflat.hint msgctxt "TFMAIN.TOOL_CAPFLAT.HINT" @@ -1792,139 +1798,138 @@ msgstr "Apaļš gals" #: tfmain.tool_capsquare.hint msgctxt "TFMAIN.TOOL_CAPSQUARE.HINT" msgid "Square cap" -msgstr "" +msgstr "Stūrains gals" #: tfmain.tool_closeshape.hint -msgctxt "TFMAIN.TOOL_CLOSESHAPE.HINT" +msgctxt "tfmain.tool_closeshape.hint" msgid "Close shape" -msgstr "" +msgstr "Noslēdz daudzstūri" #: tfmain.tool_curvemodeangle.hint msgid "Draw an angle" -msgstr "" +msgstr "Lauzuma punkts" #: tfmain.tool_curvemodeauto.hint -msgctxt "TFMAIN.TOOL_CURVEMODEAUTO.HINT" +msgctxt "tfmain.tool_curvemodeauto.hint" msgid "Autodetect angles" -msgstr "" +msgstr "Pašnoteikti leņķi" #: tfmain.tool_curvemodecurve.hint msgid "Draw a curve" -msgstr "" +msgstr "Liekuma punkts" #: tfmain.tool_curvemovepoint.hint msgid "Move point" -msgstr "" +msgstr "Pārvietot punktu" #: tfmain.tool_drawshapeborder.hint -msgctxt "TFMAIN.TOOL_DRAWSHAPEBORDER.HINT" +msgctxt "tfmain.tool_drawshapeborder.hint" msgid "Draw border" -msgstr "" +msgstr "Zīmēt apmali" #: tfmain.tool_erasealpha.hint -msgctxt "TFMAIN.TOOL_ERASEALPHA.HINT" +msgctxt "tfmain.tool_erasealpha.hint" msgid "Make transparent" -msgstr "" +msgstr "Caurspīdīgs" #: tfmain.tool_eraseblur.hint -msgctxt "TFMAIN.TOOL_ERASEBLUR.HINT" +msgctxt "tfmain.tool_eraseblur.hint" msgid "Soften" -msgstr "" +msgstr "Mīkstāks" #: tfmain.tool_erasedarken.hint msgid "Darken" -msgstr "" +msgstr "Tumšāks" #: tfmain.tool_eraselighten.hint msgid "Lighten" -msgstr "" +msgstr "Gaišāks" #: tfmain.tool_erasesharpen.hint msgid "Sharpen" -msgstr "" +msgstr "Asāks" #: tfmain.tool_fillshape.hint -msgctxt "TFMAIN.TOOL_FILLSHAPE.HINT" +msgctxt "tfmain.tool_fillshape.hint" msgid "Fill shape" -msgstr "" +msgstr "Aizpildi daudzstūri" #: tfmain.tool_gridmovewithoutdeformation.hint -msgctxt "TFMAIN.TOOL_GRIDMOVEWITHOUTDEFORMATION.HINT" +msgctxt "tfmain.tool_gridmovewithoutdeformation.hint" msgid "Move grid without deformation" -msgstr "" +msgstr "Pārvietot tīklu nedeformējot" #: tfmain.tool_joinbevel.hint msgctxt "TFMAIN.TOOL_JOINBEVEL.HINT" msgid "Bevel join" -msgstr "" +msgstr "Nošķelts savienojums" #: tfmain.tool_joinmiter.hint msgctxt "TFMAIN.TOOL_JOINMITER.HINT" msgid "Miter join" -msgstr "" +msgstr "Salidums" #: tfmain.tool_joinround.hint msgctxt "TFMAIN.TOOL_JOINROUND.HINT" msgid "Round join" -msgstr "" +msgstr "Apaļš savienojums" #: tfmain.tool_phongshapecone.hint -msgctxt "TFMAIN.TOOL_PHONGSHAPECONE.HINT" +msgctxt "tfmain.tool_phongshapecone.hint" msgid "Cone" -msgstr "" +msgstr "Konuss no augšas" #: tfmain.tool_phongshapehorizontalcylinder.hint -msgctxt "TFMAIN.TOOL_PHONGSHAPEHORIZONTALCYLINDER.HINT" +msgctxt "tfmain.tool_phongshapehorizontalcylinder.hint" msgid "Horizontal cylinder" -msgstr "" +msgstr "Gulenisks cilindrs" #: tfmain.tool_phongshaperectangle.hint -msgctxt "TFMAIN.TOOL_PHONGSHAPERECTANGLE.HINT" +msgctxt "tfmain.tool_phongshaperectangle.hint" msgid "Rectangle" -msgstr "Taisns" +msgstr "Taisnstūris" #: tfmain.tool_phongshaperoundrect.hint -msgctxt "TFMAIN.TOOL_PHONGSHAPEROUNDRECT.HINT" +msgctxt "tfmain.tool_phongshaperoundrect.hint" msgid "Rounded rectangle" -msgstr "Noapaļots tais" +msgstr "Noapaļots taisnstūris" #: tfmain.tool_phongshapesphere.hint -msgctxt "TFMAIN.TOOL_PHONGSHAPESPHERE.HINT" +msgctxt "tfmain.tool_phongshapesphere.hint" msgid "Sphere" msgstr "Lode" #: tfmain.tool_phongshapeverticalcone.hint -msgctxt "TFMAIN.TOOL_PHONGSHAPEVERTICALCONE.HINT" +msgctxt "tfmain.tool_phongshapeverticalcone.hint" msgid "Vertical cone" -msgstr "Stāvošs konuss" +msgstr "Konuss sānskatā" #: tfmain.tool_phongshapeverticalcylinder.hint -msgctxt "TFMAIN.TOOL_PHONGSHAPEVERTICALCYLINDER.HINT" +msgctxt "tfmain.tool_phongshapeverticalcylinder.hint" msgid "Vertical cylinder" -msgstr "Stāvošs cilindrs" +msgstr "Statenisks cilindrs" #: tfmain.tool_progressivefloodfill.caption -#, fuzzy -msgctxt "TFMAIN.TOOL_PROGRESSIVEFLOODFILL.CAPTION" +msgctxt "tfmain.tool_progressivefloodfill.caption" msgid "Progressive floodfill" msgstr "Vienmērīgs aizpildījums" #: tfmain.tool_progressivefloodfill.hint -msgctxt "TFMAIN.TOOL_PROGRESSIVEFLOODFILL.HINT" +msgctxt "tfmain.tool_progressivefloodfill.hint" msgid "Progressive floodfill" msgstr "Vienmērīgs aizpildījums" #: tfmain.tool_textaligncenter.hint msgid "Center" -msgstr "" +msgstr "Iecentrēt" #: tfmain.tool_textalignleft.hint msgid "Align left" -msgstr "" +msgstr "Līdzināt pa kreisi" #: tfmain.tool_textalignright.hint msgid "Align right" -msgstr "" +msgstr "Līdzināt pa labi" #: tfmain.tool_textfont.hint msgctxt "TFMAIN.TOOL_TEXTFONT.HINT" @@ -1953,7 +1958,7 @@ msgstr "Krāsas" #: tfmain.viewdarktheme.caption msgid "Dark theme" -msgstr "" +msgstr "Tumšais izskats" #: tfmain.viewgrid.caption msgctxt "TFMAIN.VIEWGRID.CAPTION" @@ -1970,14 +1975,14 @@ msgid "Layers" msgstr "Slaņi" #: tfmain.viewlayerstackbutton.caption -msgctxt "TFMAIN.VIEWLAYERSTACKBUTTON.CAPTION" +msgctxt "tfmain.viewlayerstackbutton.caption" msgid "Show layers" msgstr "Rādīt slāņus" #: tfmain.viewlayerstackbutton.hint -msgctxt "TFMAIN.VIEWLAYERSTACKBUTTON.HINT" +msgctxt "tfmain.viewlayerstackbutton.hint" msgid "Show or hide layer stack window" -msgstr "Parāda/paslēpj slāņu saraksta logu" +msgstr "Parāda/paslēpj slāņu saraksta logu" #: tfmain.viewpalette.caption msgctxt "tfmain.viewpalette.caption" @@ -1986,7 +1991,7 @@ msgstr "Palete" #: tfmain.viewstatusbar.caption msgid "Status bar" -msgstr "" +msgstr "Stāvokļa josla" #: tfmain.viewtoolbox.caption msgid "Toolbox" @@ -1994,7 +1999,7 @@ msgstr "Rīku kaste" #: tfmain.viewworkspacecolor.caption msgid "Set workspace color..." -msgstr "" +msgstr "Darbavirsmas krāsa ..." #: tfmain.viewzoomfit.caption msgctxt "tfmain.viewzoomfit.caption" @@ -2028,7 +2033,7 @@ msgstr "Tālināt" #: tfmotionblur.button_cancel.caption msgctxt "TFMOTIONBLUR.BUTTON_CANCEL.CAPTION" msgid "Cancel" -msgstr "Atsaukt" +msgstr "Atcelt" #: tfmotionblur.button_ok.caption msgctxt "TFMOTIONBLUR.BUTTON_OK.CAPTION" @@ -2036,7 +2041,7 @@ msgid "OK" msgstr "Labi" #: tfmotionblur.caption -msgctxt "TFMOTIONBLUR.CAPTION" +msgctxt "tfmotionblur.caption" msgid "Motion blur" msgstr "Kustības izplūdums" @@ -2045,17 +2050,17 @@ msgid "Oriented" msgstr "Virzīts" #: tfmotionblur.label_distance.caption -msgctxt "TFMOTIONBLUR.LABEL_DISTANCE.CAPTION" +msgctxt "tfmotionblur.label_distance.caption" msgid "Distance :" msgstr "Attālums:" #: tfmultiimage.button_cancel.caption -msgctxt "TFMULTIIMAGE.BUTTON_CANCEL.CAPTION" +msgctxt "tfmultiimage.button_cancel.caption" msgid "Cancel" -msgstr "Atsaukt" +msgstr "Atcelt" #: tfmultiimage.button_ok.caption -msgctxt "TFMULTIIMAGE.BUTTON_OK.CAPTION" +msgctxt "tfmultiimage.button_ok.caption" msgid "OK" msgstr "Labi" @@ -2066,7 +2071,7 @@ msgstr "Izvēlies attēlu" #: tfnewimage.button_cancel.caption msgctxt "TFNEWIMAGE.BUTTON_CANCEL.CAPTION" msgid "Cancel" -msgstr "Atsaukt" +msgstr "Atcelt" #: tfnewimage.button_ok.caption msgctxt "TFNEWIMAGE.BUTTON_OK.CAPTION" @@ -2074,43 +2079,43 @@ msgid "OK" msgstr "Labi" #: tfnewimage.caption -msgctxt "TFNEWIMAGE.CAPTION" +msgctxt "tfnewimage.caption" msgid "New image" msgstr "Jauns attēls" #: tfnewimage.combobox_bitdepth.text msgid "32" -msgstr "" +msgstr "32" #: tfnewimage.label_bitdepth.caption msgid "Bit depth :" -msgstr "" +msgstr "Dziļums bitos:" #: tfnewimage.label_height.caption -msgctxt "TFNEWIMAGE.LABEL_HEIGHT.CAPTION" +msgctxt "tfnewimage.label_height.caption" msgid "Height :" msgstr "Augstums:" #: tfnewimage.label_height1.caption msgid "Ratio :" -msgstr "" +msgstr "Attiecība:" #: tfnewimage.label_memoryrequired.caption msgid "Memory required :" -msgstr "" +msgstr "Nepieciešamā atmiņa:" #: tfnewimage.label_width.caption -msgctxt "TFNEWIMAGE.LABEL_WIDTH.CAPTION" +msgctxt "tfnewimage.label_width.caption" msgid "Width :" msgstr "Platums:" #: tfnoisefilter.button_cancel.caption -msgctxt "TFNOISEFILTER.BUTTON_CANCEL.CAPTION" +msgctxt "tfnoisefilter.button_cancel.caption" msgid "Cancel" -msgstr "Atsaukt" +msgstr "Atcelt" #: tfnoisefilter.button_ok.caption -msgctxt "TFNOISEFILTER.BUTTON_OK.CAPTION" +msgctxt "tfnoisefilter.button_ok.caption" msgid "OK" msgstr "Labi" @@ -2120,7 +2125,7 @@ msgstr "Trokšņu filtrs" #: tfnoisefilter.label_opacity.caption msgid "Opacity:" -msgstr "Redzamība" +msgstr "Redzamība:" #: tfnoisefilter.radio_grayscalenoise.caption msgid "Grayscale noise" @@ -2131,9 +2136,9 @@ msgid "RGB noise" msgstr "RGB troksnis" #: tfobject3d.button_cancel.caption -msgctxt "TFOBJECT3D.BUTTON_CANCEL.CAPTION" +msgctxt "tfobject3d.button_cancel.caption" msgid "Cancel" -msgstr "Atsaukt" +msgstr "Atcelt" #: tfobject3d.button_loadtex.caption msgid "Texture..." @@ -2144,11 +2149,12 @@ msgid "No tex." msgstr "" #: tfobject3d.button_ok.caption -msgctxt "TFOBJECT3D.BUTTON_OK.CAPTION" +msgctxt "tfobject3d.button_ok.caption" msgid "OK" msgstr "Labi" #: tfobject3d.caption +#, fuzzy msgid "3D object" msgstr "3D veidojums" @@ -2169,12 +2175,12 @@ msgid "Selected light" msgstr "Izvēlētā gaisma" #: tfobject3d.groupbox_selectedmaterial.caption -msgctxt "TFOBJECT3D.GROUPBOX_SELECTEDMATERIAL.CAPTION" +msgctxt "tfobject3d.groupbox_selectedmaterial.caption" msgid "Selected material" msgstr "Izvēlētais materiāls" #: tfobject3d.label_color.caption -msgctxt "TFOBJECT3D.LABEL_COLOR.CAPTION" +msgctxt "tfobject3d.label_color.caption" msgid "Color :" msgstr "Krāsa:" @@ -2184,12 +2190,12 @@ msgid "Color :" msgstr "Krāsa:" #: tfobject3d.label_height.caption -msgctxt "TFOBJECT3D.LABEL_HEIGHT.CAPTION" +msgctxt "tfobject3d.label_height.caption" msgid "Height :" msgstr "Augstums:" #: tfobject3d.label_lightingnormals.caption -msgctxt "TFOBJECT3D.LABEL_LIGHTINGNORMALS.CAPTION" +msgctxt "tfobject3d.label_lightingnormals.caption" msgid "Lighting normals :" msgstr "Apgaismojuma normāles:" @@ -2198,27 +2204,27 @@ msgid "Lights :" msgstr "Gaismas:" #: tfobject3d.label_materials.caption -msgctxt "TFOBJECT3D.LABEL_MATERIALS.CAPTION" +msgctxt "tfobject3d.label_materials.caption" msgid "Materials :" msgstr "Materiāli:" #: tfobject3d.label_opacity.caption -msgctxt "TFOBJECT3D.LABEL_OPACITY.CAPTION" +msgctxt "tfobject3d.label_opacity.caption" msgid "Opacity :" msgstr "Redzamība:" #: tfobject3d.label_specularindex.caption -msgctxt "TFOBJECT3D.LABEL_SPECULARINDEX.CAPTION" +msgctxt "tfobject3d.label_specularindex.caption" msgid "Spec. index :" msgstr "" #: tfobject3d.label_width.caption -msgctxt "TFOBJECT3D.LABEL_WIDTH.CAPTION" +msgctxt "tfobject3d.label_width.caption" msgid "Width :" msgstr "Platums:" #: tfobject3d.label_zoom.caption -msgctxt "TFOBJECT3D.LABEL_ZOOM.CAPTION" +msgctxt "tfobject3d.label_zoom.caption" msgid "Zoom" msgstr "Tuvinājums" @@ -2231,7 +2237,7 @@ msgid "Materials" msgstr "Materiāli" #: tfobject3d.opentexturedialog.title -msgctxt "TFOBJECT3D.OPENTEXTUREDIALOG.TITLE" +msgctxt "tfobject3d.opentexturedialog.title" msgid "Open texture" msgstr "Atvērt virsmas rakstu" @@ -2252,22 +2258,22 @@ msgid "Remove selected light" msgstr "Izmest doto gaismu" #: tfphongfilter.button_cancel.caption -msgctxt "TFPHONGFILTER.BUTTON_CANCEL.CAPTION" +msgctxt "tfphongfilter.button_cancel.caption" msgid "Cancel" -msgstr "Atsaukt" +msgstr "Atcelt" #: tfphongfilter.button_ok.caption -msgctxt "TFPHONGFILTER.BUTTON_OK.CAPTION" +msgctxt "tfphongfilter.button_ok.caption" msgid "OK" msgstr "Labi" #: tfphongfilter.caption -msgctxt "TFPHONGFILTER.CAPTION" +msgctxt "tfphongfilter.caption" msgid "Shaded map" msgstr "Ēnota virsma" #: tfphongfilter.groupbox_color.caption -msgctxt "TFPHONGFILTER.GROUPBOX_COLOR.CAPTION" +msgctxt "tfphongfilter.groupbox_color.caption" msgid "Color" msgstr "Krāsa" @@ -2277,11 +2283,11 @@ msgstr "Virsmas pacēlums" #: tfphongfilter.label_altitude.caption msgid "Global altitude :" -msgstr "Kopējais pacēlums" +msgstr "Kopējais pacēlums:" #: tfphongfilter.label_lightposition.caption msgid "Light position :" -msgstr "Gaismas avots" +msgstr "Gaismas avots:" #: tfphongfilter.radio_mapalpha.caption msgid "Alpha" @@ -2296,7 +2302,7 @@ msgid "G" msgstr "G" #: tfphongfilter.radio_maplightness.caption -msgctxt "TFPHONGFILTER.RADIO_MAPLIGHTNESS.CAPTION" +msgctxt "tfphongfilter.radio_maplightness.caption" msgid "Lightness" msgstr "Gaišums" @@ -2309,7 +2315,7 @@ msgid "R" msgstr "R" #: tfphongfilter.radio_mapsaturation.caption -msgctxt "TFPHONGFILTER.RADIO_MAPSATURATION.CAPTION" +msgctxt "tfphongfilter.radio_mapsaturation.caption" msgid "Saturation" msgstr "Piesātinājums" @@ -2326,14 +2332,14 @@ msgid "Pen color" msgstr "Otas krāsa" #: tfphongfilter.radio_usetexture.caption -msgctxt "TFPHONGFILTER.RADIO_USETEXTURE.CAPTION" +msgctxt "tfphongfilter.radio_usetexture.caption" msgid "Current texture" msgstr "Virsmas raksts" #: tfpixelate.button_cancel.caption msgctxt "TFPIXELATE.BUTTON_CANCEL.CAPTION" msgid "Cancel" -msgstr "Atsaukt" +msgstr "Atcelt" #: tfpixelate.button_ok.caption msgctxt "TFPIXELATE.BUTTON_OK.CAPTION" @@ -2341,34 +2347,34 @@ msgid "OK" msgstr "Labi" #: tfpixelate.caption -msgctxt "TFPIXELATE.CAPTION" +msgctxt "tfpixelate.caption" msgid "Pixelate" -msgstr "" +msgstr "Apvienot pikseļus" #: tfpixelate.label_pixelsize.caption -msgctxt "TFPIXELATE.LABEL_PIXELSIZE.CAPTION" +msgctxt "tfpixelate.label_pixelsize.caption" msgid "Pixel size :" -msgstr "" +msgstr "Pikseļa izmērs:" #: tfpixelate.label_quality.caption -msgctxt "TFPIXELATE.LABEL_QUALITY.CAPTION" +msgctxt "tfpixelate.label_quality.caption" msgid "Quality :" -msgstr "" +msgstr "Kvalitāte:" #: tfposterize.button_cancel.caption -msgctxt "TFPOSTERIZE.BUTTON_CANCEL.CAPTION" +msgctxt "tfposterize.button_cancel.caption" msgid "Cancel" -msgstr "Atsaukt" +msgstr "Atcelt" #: tfposterize.button_ok.caption -msgctxt "TFPOSTERIZE.BUTTON_OK.CAPTION" +msgctxt "tfposterize.button_ok.caption" msgid "OK" msgstr "Labi" #: tfposterize.caption -msgctxt "TFPOSTERIZE.CAPTION" +msgctxt "tfposterize.caption" msgid "Posterize" -msgstr "Samazināts krāsu daudzums" +msgstr "Plakāta efekts" #: tfposterize.checkbox_bylightness.caption msgid "By lightness" @@ -2380,7 +2386,7 @@ msgstr "Līmeņi:" #: tfpreviewdialog.caption msgid "Preview" -msgstr "" +msgstr "Priekšskatījums" #: tfpreviewdialog.lstatus.caption msgctxt "tfpreviewdialog.lstatus.caption" @@ -2396,16 +2402,16 @@ msgid "Print!" msgstr "Drukāt!" #: tfprint.button_zoomfit.caption -msgctxt "TFPRINT.BUTTON_ZOOMFIT.CAPTION" +msgctxt "tfprint.button_zoomfit.caption" msgid "Zoom fit" -msgstr "Pielāgot lapai" +msgstr "Ietilpināt logā" #: tfprint.caption msgid "Print" msgstr "Drukāt" #: tfprint.checkbox_ratio.caption -msgctxt "TFPRINT.CHECKBOX_RATIO.CAPTION" +msgctxt "tfprint.checkbox_ratio.caption" msgid "Keep aspect ratio" msgstr "Saglabāt attiecību" @@ -2422,18 +2428,18 @@ msgid "Bottom:" msgstr "Apakšā:" #: tfprint.label_dpix.caption -msgctxt "TFPRINT.LABEL_DPIX.CAPTION" +msgctxt "tfprint.label_dpix.caption" msgid "." msgstr "." #: tfprint.label_dpiy.caption -msgctxt "TFPRINT.LABEL_DPIY.CAPTION" +msgctxt "tfprint.label_dpiy.caption" msgid "." msgstr "." #: tfprint.label_height.caption msgid "Height:" -msgstr "Augstums" +msgstr "Augstums:" #: tfprint.label_left.caption msgid "Left:" @@ -2441,11 +2447,11 @@ msgstr "Kreisā pusē:" #: tfprint.label_orientation.caption msgid "Orientation:" -msgstr "Orientācija" +msgstr "Orientācija:" #: tfprint.label_printerandpaper.caption msgid "Printer and paper:" -msgstr "Drukas iekārta un papīrs" +msgstr "Drukas iekārta un papīrs:" #: tfprint.label_right.caption msgid "Right:" @@ -2457,15 +2463,15 @@ msgstr "Augšā:" #: tfprint.label_width.caption msgid "Width:" -msgstr "Platums" +msgstr "Platums:" #: tfquestion.caption msgid "Question" -msgstr "" +msgstr "Jautājums" #: tfquestion.checkbox_rememberchoice.caption msgid "Remember this choice" -msgstr "" +msgstr "Atcerēties izvēlēto" #: tfquestion.label_message.caption msgctxt "tfquestion.label_message.caption" @@ -2475,7 +2481,7 @@ msgstr "." #: tfradialblur.button_cancel.caption msgctxt "TFRADIALBLUR.BUTTON_CANCEL.CAPTION" msgid "Cancel" -msgstr "Atsaukt" +msgstr "Atcelt" #: tfradialblur.button_ok.caption msgctxt "TFRADIALBLUR.BUTTON_OK.CAPTION" @@ -2483,19 +2489,19 @@ msgid "OK" msgstr "Labi" #: tfradialblur.caption -msgctxt "TFRADIALBLUR.CAPTION" +msgctxt "tfradialblur.caption" msgid "Radial blur" -msgstr "Izpludināšana" +msgstr "Vienmērīga izpludināšana" #: tfradialblur.label_radius.caption -msgctxt "TFRADIALBLUR.LABEL_RADIUS.CAPTION" +msgctxt "tfradialblur.label_radius.caption" msgid "Radius :" msgstr "Rādiuss:" #: tfrain.button_cancel.caption msgctxt "tfrain.button_cancel.caption" msgid "Cancel" -msgstr "Atsaukt" +msgstr "Atcelt" #: tfrain.button_ok.caption msgctxt "tfrain.button_ok.caption" @@ -2508,16 +2514,16 @@ msgstr "Lietus" #: tfrain.label_quantity.caption msgid "Quantity:" -msgstr "Stiprums" +msgstr "Stiprums:" #: tfrain.label_wind.caption msgid "Wind :" -msgstr "Vējš" +msgstr "Vējš:" #: tfresample.button_cancel.caption msgctxt "TFRESAMPLE.BUTTON_CANCEL.CAPTION" msgid "Cancel" -msgstr "Atsaukt" +msgstr "Atcelt" #: tfresample.button_ok.caption msgctxt "TFRESAMPLE.BUTTON_OK.CAPTION" @@ -2525,7 +2531,7 @@ msgid "OK" msgstr "Labi" #: tfresample.caption -msgctxt "TFRESAMPLE.CAPTION" +msgctxt "tfresample.caption" msgid "Resample" msgstr "Izmēra maiņa" @@ -2535,24 +2541,24 @@ msgid "Keep aspect ratio" msgstr "Saglabāt attiecību" #: tfresample.label_height.caption -msgctxt "TFRESAMPLE.LABEL_HEIGHT.CAPTION" +msgctxt "tfresample.label_height.caption" msgid "Height :" msgstr "Augstums:" #: tfresample.label_quality.caption -msgctxt "TFRESAMPLE.LABEL_QUALITY.CAPTION" +msgctxt "tfresample.label_quality.caption" msgid "Quality :" -msgstr "" +msgstr "Kvalitāte:" #: tfresample.label_width.caption -msgctxt "TFRESAMPLE.LABEL_WIDTH.CAPTION" +msgctxt "tfresample.label_width.caption" msgid "Width :" msgstr "Platums:" #: tfsaveoption.button_cancel.caption msgctxt "tfsaveoption.button_cancel.caption" msgid "Cancel" -msgstr "Atsaukt" +msgstr "Atcelt" #: tfsaveoption.button_ok.caption msgctxt "tfsaveoption.button_ok.caption" @@ -2570,7 +2576,7 @@ msgstr "Neīstā tonēšana" #: tfsaveoption.label1.caption msgid "Quality:" -msgstr "" +msgstr "Kvalitāte:" #: tfsaveoption.label_0.caption msgid "0" @@ -2598,7 +2604,7 @@ msgstr "16 krāsas" #: tfsaveoption.radiobutton_24bitsperpixel.caption msgid "24 bits" -msgstr "24 bitu" +msgstr "24 biti" #: tfsaveoption.radiobutton_256colors.caption msgid "256 colors" @@ -2610,19 +2616,19 @@ msgstr "2 krāsas" #: tfsaveoption.radiobutton_32bitsperpixel.caption msgid "32 bits" -msgstr "" +msgstr "32 biti" #: tfsaveoption.radiobutton_miomap.caption msgid "MioMap" msgstr "" #: tfsharpen.button_cancel.caption -msgctxt "TFSHARPEN.BUTTON_CANCEL.CAPTION" +msgctxt "tfsharpen.button_cancel.caption" msgid "Cancel" -msgstr "Atsaukt" +msgstr "Atcelt" #: tfsharpen.button_ok.caption -msgctxt "TFSHARPEN.BUTTON_OK.CAPTION" +msgctxt "tfsharpen.button_ok.caption" msgid "OK" msgstr "Labi" @@ -2631,14 +2637,14 @@ msgid "Sharpen/Smooth" msgstr "Asināt/Nogludināt" #: tfsharpen.label_amount.caption -msgctxt "TFSHARPEN.LABEL_AMOUNT.CAPTION" +msgctxt "tfsharpen.label_amount.caption" msgid "Amount :" -msgstr "" +msgstr "Stiprums:" #: tfshiftcolors.button_cancel.caption msgctxt "TFSHIFTCOLORS.BUTTON_CANCEL.CAPTION" msgid "Cancel" -msgstr "Atsaukt" +msgstr "Atcelt" #: tfshiftcolors.button_ok.caption msgctxt "TFSHIFTCOLORS.BUTTON_OK.CAPTION" @@ -2646,7 +2652,7 @@ msgid "OK" msgstr "Labi" #: tfshiftcolors.caption -msgctxt "TFSHIFTCOLORS.CAPTION" +msgctxt "tfshiftcolors.caption" msgid "Shift colors" msgstr "Nobīdīt krāsas" @@ -2666,14 +2672,14 @@ msgid "Saturation" msgstr "Piesātinājums" #: tftoolbox.caption -msgctxt "TFTOOLBOX.CAPTION" +msgctxt "tftoolbox.caption" msgid "Tools" msgstr "Rīki" #: tftwirl.button_cancel.caption msgctxt "TFTWIRL.BUTTON_CANCEL.CAPTION" msgid "Cancel" -msgstr "Atsaukt" +msgstr "Atcelt" #: tftwirl.button_ok.caption msgctxt "TFTWIRL.BUTTON_OK.CAPTION" @@ -2681,24 +2687,24 @@ msgid "OK" msgstr "Labi" #: tftwirl.caption -msgctxt "TFTWIRL.CAPTION" +msgctxt "tftwirl.caption" msgid "Twirl" msgstr "Savirpināt" #: tftwirl.label_angle.caption -msgctxt "TFTWIRL.LABEL_ANGLE.CAPTION" +msgctxt "tftwirl.label_angle.caption" msgid "Angle :" msgstr "Leņķis:" #: tftwirl.label_radius.caption -msgctxt "TFTWIRL.LABEL_RADIUS.CAPTION" +msgctxt "tftwirl.label_radius.caption" msgid "Radius :" msgstr "Rādiuss:" #: tfwavedisplacement.button_cancel.caption msgctxt "tfwavedisplacement.button_cancel.caption" msgid "Cancel" -msgstr "Atsaukt" +msgstr "Atcelt" #: tfwavedisplacement.button_ok.caption msgctxt "tfwavedisplacement.button_ok.caption" @@ -2707,19 +2713,19 @@ msgstr "Labi" #: tfwavedisplacement.caption msgid "Wave displacement" -msgstr "" +msgstr "Viļņu nobīde" #: tfwavedisplacement.label_displacement.caption msgid "Displacement :" -msgstr "" +msgstr "Nobīde:" #: tfwavedisplacement.label_phase.caption msgid "Phase :" -msgstr "" +msgstr "Fāze:" #: tfwavedisplacement.label_wavelength.caption msgid "Wavelength :" -msgstr "" +msgstr "Viļņa garums:" #: uresourcestrings.rsactioninprogress msgid "Action in progress" @@ -2731,7 +2737,7 @@ msgstr "Pievienot failus apstrādājamo attēlu sarakstam" #: uresourcestrings.rsalignshape msgid "Align shape" -msgstr "" +msgstr "Novieto vienumu" #: uresourcestrings.rsallapplications msgid "all" @@ -2751,13 +2757,14 @@ msgstr "Animētais GIF" #: uresourcestrings.rsautodetect msgid "Autodetect" -msgstr "" +msgstr "Pašnoteikts" #: uresourcestrings.rsbackspaceremovelastpoint msgid "Press BACKSPACE to remove last point" msgstr "Izmanto [BACKSPACE] lai dzēstu pēdējo punktu" #: uresourcestrings.rsbestquality +msgctxt "uresourcestrings.rsbestquality" msgid "Best quality" msgstr "Labākā kvalitāte" @@ -2784,15 +2791,15 @@ msgstr "Baiti" #: uresourcestrings.rscancel msgctxt "uresourcestrings.rscancel" msgid "Cancel" -msgstr "Atsaukt" +msgstr "Atcelt" #: uresourcestrings.rscancelledbyuser msgid "Cancelled by user" -msgstr "" +msgstr "Pārtrauca lietotājs" #: uresourcestrings.rscannotdrawshapeonsvglayer msgid "Cannot draw shape on SVG layer" -msgstr "" +msgstr "Nevar zīmēt vektorslānī" #: uresourcestrings.rscannotopenfile msgid "Cannot open file" @@ -2812,8 +2819,9 @@ msgid "Clear palette" msgstr "Notīrīt paleti" #: uresourcestrings.rscloserequest +msgctxt "uresourcestrings.rscloserequest" msgid "Close request" -msgstr "" +msgstr "Aizvērt pieprasījumu" #: uresourcestrings.rscmd msgid "CMD" @@ -2826,19 +2834,19 @@ msgstr "Krāsas" #: uresourcestrings.rsconfirmdeletefromcontainer msgid "Are you sure you want to delete this file from the container?" -msgstr "" +msgstr "Vai tiešām gribi izdzēst datni?" #: uresourcestrings.rsconfirmdeletemultiplefromcontainer msgid "Are you sure you want to delete these %1 files from the container?" -msgstr "" +msgstr "Vai tiešam gribi izdzēst šīs %1 datnes?" #: uresourcestrings.rsconfirmmovemultipletotrash msgid "Are you sure you want to move these %1 files to the trash?" -msgstr "Vai tiešam gribi šos failus (%1) izmest papīrgrozā?" +msgstr "Vai tiešam gribi šīs %1 datnes izmest papīrgrozā?" #: uresourcestrings.rsconfirmmovetotrash msgid "Are you sure you want to move this file to the trash?" -msgstr "Vai tiešam gribi šos failus izmest papīrgrozā?" +msgstr "Vai tiešam gribi šo datni izmest papīrgrozā?" #: uresourcestrings.rsconflictingactions msgid "Conflicting actions" @@ -2859,6 +2867,7 @@ msgid "Corr. Hue CW" msgstr "" #: uresourcestrings.rscosine +msgctxt "uresourcestrings.rscosine" msgid "Cosine" msgstr "" @@ -2872,7 +2881,7 @@ msgstr "" #: uresourcestrings.rscurvemodehint msgid "Press S or X to set the curve mode of the last point" -msgstr "" +msgstr "Spied [S] vai [X], lai uzdotu līknes pēdējā punkta veidu" #: uresourcestrings.rsdefaultpalette msgid "Default palette" @@ -2885,11 +2894,11 @@ msgstr "Dzēst" #: uresourcestrings.rsdeleteimageentry msgid "Delete selected image entry?" -msgstr "" +msgstr "Dzēst šo attēla daļu?" #: uresourcestrings.rsdirectorynotempty msgid "Directory is not empty" -msgstr "" +msgstr "Direktorija ir tukša" #: uresourcestrings.rsditherlayerusingpalette msgid "Dither layer using palette" @@ -2897,9 +2906,10 @@ msgstr "Tonēt izmantojot paletes krāsas" #: uresourcestrings.rsduplicateimage msgid "Duplicate image" -msgstr "" +msgstr "Pavairot attēlu" #: uresourcestrings.rseditmask +msgctxt "uresourcestrings.rseditmask" msgid "Edit mask" msgstr "Labot masku" @@ -2908,6 +2918,7 @@ msgid "Edit selection" msgstr "Labot iezīmējumu" #: uresourcestrings.rsedittexture +msgctxt "uresourcestrings.rsedittexture" msgid "Edit texture" msgstr "Labot virsmas rakstu" @@ -2921,19 +2932,19 @@ msgstr "Iezīmējums ir tukšs" #: uresourcestrings.rsendwithoutmatchingbegin msgid "End without matching begin" -msgstr "" +msgstr "Beigas bez sākuma" #: uresourcestrings.rsenterfolderorcontainername msgid "Enter name for new folder or container (using RES or LRS extension):" -msgstr "" +msgstr "Mapes vai arī resursu datnes (*.res; *.lrs) vārds:" #: uresourcestrings.rsenterlayername msgid "Enter layer name:" -msgstr "Ieraksti slāna vārdu:" +msgstr "Ieraksti slāņa vārdu:" #: uresourcestrings.rsentries msgid "Entries" -msgstr "" +msgstr "Ieraksti" #: uresourcestrings.rserror msgid "Error" @@ -2941,7 +2952,7 @@ msgstr "Kļūda" #: uresourcestrings.rserrordecodingraw msgid "Error decoding raw image." -msgstr "" +msgstr "Kļūda atkodējot attēlu." #: uresourcestrings.rserrorloadingoriginal msgid "Error while loading original however layer can be rasterized." @@ -2953,11 +2964,12 @@ msgstr "Nevar atvērt failu \"%1\"" #: uresourcestrings.rsexception msgid "An exception was encountered" -msgstr "" +msgstr "Kļūda programmatūras darbībā" #: uresourcestrings.rsexitrequest +msgctxt "uresourcestrings.rsexitrequest" msgid "Exit request" -msgstr "" +msgstr "Darba beigas" #: uresourcestrings.rsexpect1parameter msgid "expects one parameter : " @@ -2972,24 +2984,26 @@ msgid "expects N parameters : " msgstr "vajadzīgi N parametri: " #: uresourcestrings.rsfast +msgctxt "uresourcestrings.rsfast" msgid "Fast" msgstr "Ātri" #: uresourcestrings.rsfilecannotbeempty msgid "File cannot be empty" -msgstr "" +msgstr "Datne nevar būt tukša" #: uresourcestrings.rsfiledate msgid "Date" msgstr "Datums" #: uresourcestrings.rsfileextensionnotsupported +msgctxt "uresourcestrings.rsfileextensionnotsupported" msgid "This file extension is not supported." -msgstr "Neatbalstīts faila paplašnājums" +msgstr "Neatbalstīts datnes paplašinājums." #: uresourcestrings.rsfileformatnotrecognized msgid "The file format has not been recognized." -msgstr "Nepazīstams faila formāts" +msgstr "Nepazīstams datnes formāts." #: uresourcestrings.rsfilename msgid "Filename" @@ -2997,11 +3011,11 @@ msgstr "Datnes vārds" #: uresourcestrings.rsfilenotfound msgid "File not found!" -msgstr "Fails netika atrasts!" +msgstr "Datne netika atrasts!" #: uresourcestrings.rsfilenotsaved msgid "File not saved" -msgstr "Fails netika saglabāts" +msgstr "Datne netika saglabāts" #: uresourcestrings.rsfilesize msgid "Size" @@ -3017,7 +3031,7 @@ msgstr "Veids" #: uresourcestrings.rsfixeddrive msgid "Fixed" -msgstr "" +msgstr "Nemainīgs" #: uresourcestrings.rsfolder msgid "Folder" @@ -3025,7 +3039,7 @@ msgstr "Mape" #: uresourcestrings.rsfolderorcontaineralreadyexists msgid "Folder or container already exists." -msgstr "" +msgstr "Mape vai resursu datne jau ir." #: uresourcestrings.rsfollowingerrorsoccured msgid "Following errors occured:" @@ -3033,7 +3047,7 @@ msgstr "Kļūda:" #: uresourcestrings.rsframes msgid "Frames" -msgstr "" +msgstr "Kadri" #: uresourcestrings.rsfunctionnotdefined msgid "The function %1 is not defined." @@ -3044,6 +3058,7 @@ msgid "Green" msgstr "Zaļš" #: uresourcestrings.rshalfcosine +msgctxt "uresourcestrings.rshalfcosine" msgid "Half-cosine" msgstr "" @@ -3085,16 +3100,16 @@ msgstr "" #: uresourcestrings.rsiconimagealreadyexists msgid "There is already an image with this size and depth." -msgstr "" +msgstr "Ir jau šāda izmēra attēls ar šādu krāsu dziļumu." #: uresourcestrings.rsiconorcursor msgid "Icon/cursor" -msgstr "" +msgstr "Ikona/kursors" #: uresourcestrings.rsiconsize msgctxt "uresourcestrings.rsiconsize" msgid "Icon size" -msgstr "" +msgstr "Ikonas izmērs" #: uresourcestrings.rsimagetoobig msgid "Image is too big" @@ -3103,11 +3118,11 @@ msgstr "Attēls ir par lielu" #: uresourcestrings.rsinfinity msgctxt "uresourcestrings.rsinfinity" msgid "Infinity" -msgstr "" +msgstr "Bezgalība" #: uresourcestrings.rsinformation msgid "Information" -msgstr "" +msgstr "Informācija" #: uresourcestrings.rsintensity msgctxt "uresourcestrings.rsintensity" @@ -3116,11 +3131,11 @@ msgstr "Spilgtums" #: uresourcestrings.rsinternalerror msgid "Internal error" -msgstr "" +msgstr "Iekšējā kļūda" #: uresourcestrings.rsinvalidname msgid "Invalid name" -msgstr "" +msgstr "Nepareizs vārds" #: uresourcestrings.rsinvalidopacity msgid "Invalid opacity : " @@ -3128,7 +3143,7 @@ msgstr "Nepareiza redzamība: " #: uresourcestrings.rsinvalidparameters msgid "Invalid parameters" -msgstr "" +msgstr "Nepareizi parametri" #: uresourcestrings.rsinvalidresamplesize msgid "Invalid resample size : " @@ -3136,15 +3151,16 @@ msgstr "Nepareizs jaunais izmērs: " #: uresourcestrings.rsinvalidsizefornew msgid "Invalid size for new : " -msgstr "" +msgstr "Nepareizs jaunais izmērs: " #: uresourcestrings.rskeepchanges +msgctxt "uresourcestrings.rskeepchanges" msgid "Do you want to keep changes?" -msgstr "Vai gribi sagalabāt izmaiņas?" +msgstr "Vai gribi saglabāt izmaiņas?" #: uresourcestrings.rskeepemptyspace msgid "Keep empty space around opaque pixels?" -msgstr "" +msgstr "Paturēt tukšumu ap redzamajiem pikseļiem?" #: uresourcestrings.rslanczos msgid "Lanczos %1" @@ -3174,9 +3190,10 @@ msgstr "LazPaint" #: uresourcestrings.rslazpaintonly msgid "LazPaint only" -msgstr "" +msgstr "Tikai LazPaint" #: uresourcestrings.rslight +msgctxt "uresourcestrings.rslight" msgid "Light" msgstr "Gaišums" @@ -3190,6 +3207,7 @@ msgid "Light position" msgstr "Gaismas novietojums" #: uresourcestrings.rslinear +msgctxt "uresourcestrings.rslinear" msgid "Linear" msgstr "Tiešs" @@ -3211,7 +3229,7 @@ msgstr "Ielasīt paleti ..." #: uresourcestrings.rsloopcount msgid "Loop count" -msgstr "" +msgstr "Atkārtojuma reizes" #: uresourcestrings.rsmakencolorspalettefrombitmap msgid "Make %1-colors palette from image" @@ -3219,19 +3237,23 @@ msgstr "Izveidot no attēla %1 krāsu paleti" #: uresourcestrings.rsmergeselection msgid "Do you want to merge selection?" -msgstr "" +msgstr "Vai apvienot izvēlēto?" #: uresourcestrings.rsmitchell +msgctxt "uresourcestrings.rsmitchell" msgid "Mitchell" msgstr "Mišela" #: uresourcestrings.rsmorethanonefile -msgid "You are trying to open more than one file. How would you like these files to be opened?" -msgstr "Tu centies atvērt vairāk nekā vienu failu. Kā vēlies lai tos atver?" +msgid "" +"You are trying to open more than one file. How would you like these files to " +"be opened?" +msgstr "Tu centies atvērt vairāk nekā vienu failu. Kā vēlies, lai tos atver?" #: uresourcestrings.rsmovingorrotatingselection +msgctxt "uresourcestrings.rsmovingorrotatingselection" msgid "Moving or rotating selection" -msgstr "Pārvieto vai pakriez izvēlēto" +msgstr "Pārvieto vai pagriez izvēlēto" #: uresourcestrings.rsmustreleaseselection msgid "You must first release the selection" @@ -3267,34 +3289,38 @@ msgid "Do not save and open another file" msgstr "Nesalabāt un atvērt citu failu" #: uresourcestrings.rsnoname +msgctxt "uresourcestrings.rsnoname" msgid "noname" -msgstr "bez vārda" +msgstr "bez_vaarda" #: uresourcestrings.rsnormalblendop msgid "Normal" msgstr "Parasta" #: uresourcestrings.rsnothingtobedeformed +msgctxt "uresourcestrings.rsnothingtobedeformed" msgid "There is nothing to be deformed" msgstr "Neka nav pārveidojams" #: uresourcestrings.rsnothingtoberetrieved +msgctxt "uresourcestrings.rsnothingtoberetrieved" msgid "There is nothing to be retrieved" msgstr "Nav ko atdabūt" #: uresourcestrings.rsnotreasonableformat msgid "It is not reasonable to save such a big image in this file format." -msgstr "Nav prātīgi saglabāt tik lielu attēlu šajā faila formātā" +msgstr "Nav prātīgi saglabāt tik lielu attēlu šajā datnes formātā." #: uresourcestrings.rsnumber msgid "№" -msgstr "Nr." +msgstr "Nr. " #: uresourcestrings.rsokay msgid "Okay" msgstr "Labi" #: uresourcestrings.rsopacity +msgctxt "uresourcestrings.rsopacity" msgid "Opacity" msgstr "Redzamība" @@ -3304,19 +3330,19 @@ msgstr "Atvērt" #: uresourcestrings.rsopenfilesaslayers msgid "Open files as layers in a single image" -msgstr "" +msgstr "Atvērt datnes kā viena attēla slāņus" #: uresourcestrings.rsopenfirstfileonly msgid "Open the first file only" -msgstr "" +msgstr "Atvērt tikai pirmo datni" #: uresourcestrings.rsopening msgid "Opening" -msgstr "" +msgstr "Atveru" #: uresourcestrings.rsopenmultipleimagefiles msgid "Open multiple image files" -msgstr "" +msgstr "Atver vairākas datnes" #: uresourcestrings.rsotherblendop msgid "Other..." @@ -3357,7 +3383,7 @@ msgstr "pikseļi" #: uresourcestrings.rspythonunexpectedversion msgid "Expected python version %1 but %2 found." -msgstr "" +msgstr "Pitona %1 versijas vietā atrasta %2." #: uresourcestrings.rsramdisk msgid "RAM disk" @@ -3365,7 +3391,7 @@ msgstr "" #: uresourcestrings.rsrasterlayer msgid "Raster layer" -msgstr "" +msgstr "Rastra slānis" #: uresourcestrings.rsrecentdirectories msgid "Recent directories:" @@ -3386,7 +3412,7 @@ msgstr "Attēls tika mainīts. Vai tiešām ielasīt no jauna?" #: uresourcestrings.rsremovabledrive msgid "Removable" -msgstr "" +msgstr "Noņemams" #: uresourcestrings.rsrepeatimage msgctxt "uresourcestrings.rsrepeatimage" @@ -3395,15 +3421,16 @@ msgstr "Attkārtot attēlu" #: uresourcestrings.rsresamplingimage msgid "Resampling image..." -msgstr "" +msgstr "Attēla izmēra maiņa ..." #: uresourcestrings.rsretrieveselectedarea +msgctxt "uresourcestrings.rsretrieveselectedarea" msgid "Do you want to retrieve selected area?" -msgstr "" +msgstr "Vai gribi atgūt iezīmētos laukumus?" #: uresourcestrings.rsreturnvalides msgid "Press ENTER to validate" -msgstr "" +msgstr "Nospied [Enter], lai apstiprinātu" #: uresourcestrings.rsrgb msgctxt "uresourcestrings.rsrgb" @@ -3412,7 +3439,7 @@ msgstr "RGB" #: uresourcestrings.rsrightclickforsource msgid "Use RIGHT click to define source" -msgstr "" +msgstr "Ar peles labo pogu norādi avotu" #: uresourcestrings.rssaturation msgctxt "uresourcestrings.rssaturation" @@ -3427,9 +3454,10 @@ msgstr "Saglabāt" #: uresourcestrings.rssaveasbuttonhint msgctxt "uresourcestrings.rssaveasbuttonhint" msgid "Save with specified filename" -msgstr "" +msgstr "Saglabāt ar uzdotu datnes vārdu" #: uresourcestrings.rssavechanges +msgctxt "uresourcestrings.rssavechanges" msgid "Current bitmap has been modified. Do you want to save changes?" msgstr "Pašlaik atvērtais attēls ir izmainīts. Vai saglabāt izmaiņas?" @@ -3440,17 +3468,17 @@ msgstr "Saglabāt paleti kā ..." #: uresourcestrings.rsscript msgctxt "uresourcestrings.rsscript" msgid "Script" -msgstr "" +msgstr "Skripts" #: uresourcestrings.rsselectblendoperation -#, fuzzy msgctxt "uresourcestrings.rsselectblendoperation" msgid "Select blend operation" msgstr "Izvēlies sapludināšanu" #: uresourcestrings.rsshift -msgid "SHIFT" -msgstr "" +msgctxt "uresourcestrings.rsShift" +msgid "Shift" +msgstr "Shift" #: uresourcestrings.rsshowpalette msgctxt "uresourcestrings.rsshowpalette" @@ -3459,7 +3487,7 @@ msgstr "Rādīt paleti" #: uresourcestrings.rssourceposition msgid "Source position" -msgstr "" +msgstr "Avots" #: uresourcestrings.rsspline msgctxt "uresourcestrings.rsspline" @@ -3477,11 +3505,14 @@ msgstr "Virsma ar rakstu" #: uresourcestrings.rstherearenocheckeditems msgid "There are no checked items. Check some items or add some new ones." -msgstr "" +msgstr "Nekas nav atzīmēts. Vai nu atzīmē, vai pievieno ko jaunu." #: uresourcestrings.rsthereisnofilenamegivenforthisfileusesaveas -msgid "There is no file name given for this file. Use \"Save as...\" from the main menu." -msgstr "Dotajai datnei nav piešķirts vārds. Lieto „Saglabāt kā ...” datnes izvēlnē." +msgid "" +"There is no file name given for this file. Use \"Save as...\" from the main " +"menu." +msgstr "" +"Dotajai datnei nav piešķirts vārds. Lieto „Saglabāt kā ...” datnes izvēlnē." #: uresourcestrings.rstodo msgid "To do" @@ -3493,19 +3524,19 @@ msgstr "Palicis: %1" #: uresourcestrings.rstooloninvisiblelayer msgid "Tool cannot be used on an invisible layer" -msgstr "" +msgstr "Rīku nevar pielietot neredzam slānim" #: uresourcestrings.rstoomanyactions msgid "Too many actions" -msgstr "" +msgstr "Pārāk daudz darbību" #: uresourcestrings.rstoomanylayers msgid "Too many layers" -msgstr "" +msgstr "Pārāk daudz slāņu" #: uresourcestrings.rstoomanyshapesinlayer msgid "Too many shapes in layer" -msgstr "" +msgstr "Pārāk daudz objektu slānī" #: uresourcestrings.rstotalimages msgid "Total images: %1" @@ -3517,48 +3548,46 @@ msgstr "Pārvietot iezīmējumu uz citu slāni?" #: uresourcestrings.rstransformedrasterlayer msgid "Transformed raster layer" -msgstr "" +msgstr "Pārveidots rastra slānis" #: uresourcestrings.rstransformselectioncontent msgid "Do you want to transform content of the selection?" -msgstr "" +msgstr "Vai gribi pārveidot iezīmējuma saturu?" #: uresourcestrings.rsunabletoapplyfilter msgid "Unable to apply filter : " -msgstr "Nav iespējams pielietot filtru:" +msgstr "Nav iespējams pielietot filtru: " #: uresourcestrings.rsunabletoloadfile msgid "Unable to load file : " -msgstr "Nevar atvērt failu:" +msgstr "Nevar atvērt datni: " #: uresourcestrings.rsunabletosavefile msgid "Unable to save file : " -msgstr "Nevar saglabāt failu:" +msgstr "Nevar saglabāt datni: " #: uresourcestrings.rsunknowncommand msgid "Unknown command : " -msgstr "Nepazīstama komanda:" +msgstr "Nepazīstama komanda: " #: uresourcestrings.rsunknownoriginal msgid "Unknown original" -msgstr "" +msgstr "Nepazīstams oriģināls" #: uresourcestrings.rsvectoriallayer msgid "Vectorial layer" -msgstr "" +msgstr "Vektoru slānis" #: uresourcestrings.rsyes msgid "Yes" msgstr "Jā" #: uresourcestrings.rszoomlayerstackin -#, fuzzy msgctxt "uresourcestrings.rszoomlayerstackin" msgid "Zoom layer stack in" msgstr "Pietuvināt slāņu sarakstu" #: uresourcestrings.rszoomlayerstackout -#, fuzzy msgctxt "uresourcestrings.rszoomlayerstackout" msgid "Zoom layer stack out" msgstr "Attālināt slāņu sarakstu" diff --git a/lazpaint/release/bin/i18n/lcresourcestring.lv.po b/lazpaint/release/bin/i18n/lcresourcestring.lv.po index 97afc073..6ab530e2 100644 --- a/lazpaint/release/bin/i18n/lcresourcestring.lv.po +++ b/lazpaint/release/bin/i18n/lcresourcestring.lv.po @@ -1,9 +1,19 @@ msgid "" -msgstr "Content-Type: text/plain; charset=UTF-8" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: Kārlis Kalviškis \n" +"Language-Team: \n" +"Language: lv\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.2.1\n" #: lcresourcestring.rsadjusttoshape msgid "Adjust to shape" -msgstr "" +msgstr "Pielāgot objektam" #: lcresourcestring.rscigsbnegative msgid "Corr. HSL CCW" @@ -35,19 +45,19 @@ msgstr "Krāsa" #: lcresourcestring.rscolorinterpolation msgid "Color interpolation" -msgstr "" +msgstr "Krāsu pārejas veids" #: lcresourcestring.rseditgradtexpoints msgid "Edit gradient/texture points" -msgstr "" +msgstr "Labot izvietojuma punktus" #: lcresourcestring.rsendopacity msgid "End opacity" -msgstr "" +msgstr "Beigu redzamība" #: lcresourcestring.rsgradientangular msgid "Angular" -msgstr "" +msgstr "Leņķiska" #: lcresourcestring.rsgradientdiamond msgid "Diamond" @@ -71,19 +81,19 @@ msgstr "Spoguļveida" #: lcresourcestring.rsgradientrepetition msgid "Gradient repetition" -msgstr "" +msgstr "Toņu pārejas atkārtošanās" #: lcresourcestring.rsgrpad msgid "Pad" -msgstr "" +msgstr "Aizpilda" #: lcresourcestring.rsgrreflect msgid "Reflect" -msgstr "" +msgstr "Spoguļskats" #: lcresourcestring.rsgrrepeat msgid "Repeat" -msgstr "" +msgstr "Atkārtojas" #: lcresourcestring.rsgrsine msgid "Sine" @@ -91,11 +101,11 @@ msgstr "Viļnveida" #: lcresourcestring.rsincompatibletype msgid "Incompatible type" -msgstr "" +msgstr "Nesaderīgs veids" #: lcresourcestring.rsindexoutofbounds msgid "Index out of bounds" -msgstr "" +msgstr "Vērtība ārpus atļautā" #: lcresourcestring.rslightposition msgid "Light position" @@ -107,11 +117,11 @@ msgstr "Ielasīt virsmas rakstu" #: lcresourcestring.rsnofill msgid "No fill" -msgstr "" +msgstr "Bez pildījuma" #: lcresourcestring.rsnottexturefill msgid "It is not a texture fill" -msgstr "" +msgstr "Nav aizpildīts ar rakstu" #: lcresourcestring.rsopacity msgid "Opacity" @@ -123,19 +133,19 @@ msgstr "Priekšskatīt" #: lcresourcestring.rsshapeclassnotspecified msgid "Shape class not specified" -msgstr "" +msgstr "Nav norādīta objekta klase" #: lcresourcestring.rsshapenotfound msgid "Shape not found" -msgstr "" +msgstr "Objekts netika atrasts" #: lcresourcestring.rssolidcolor msgid "Solid color" -msgstr "" +msgstr "Viendabīga krāsa" #: lcresourcestring.rsstartopacity msgid "Start opacity" -msgstr "" +msgstr "Sākuma redzamība" #: lcresourcestring.rsswapcolors msgid "Swap colors" @@ -143,29 +153,28 @@ msgstr "Apmainīt krāsas vietām" #: lcresourcestring.rstexturefill msgid "Texture fill" -msgstr "" +msgstr "Aizpildīt ar rakstu" #: lcresourcestring.rstexturerepetition msgid "Texture repetition" -msgstr "" +msgstr "Raksta atkārtošana" #: lcresourcestring.rstrnone msgid "No repetition" -msgstr "" +msgstr "Neatkārtot" #: lcresourcestring.rstrrepeatboth msgid "Repeat both" -msgstr "" +msgstr "Atkārtot abējādi" #: lcresourcestring.rstrrepeatx msgid "Repeat X" -msgstr "" +msgstr "Atkārtot uz sāniem" #: lcresourcestring.rstrrepeaty msgid "Repeat Y" -msgstr "" +msgstr "Atkārtot uz augšu/leju" #: lcresourcestring.rsunknownshapeclass msgid "Unknown shape class \"%1\"" -msgstr "" - +msgstr "Nepazīstama objekta klase \"%1\"" From 47ab565e7de845a03984ae5ed24cfec6d15a2dc3 Mon Sep 17 00:00:00 2001 From: johann Date: Wed, 11 Mar 2020 12:32:00 +0100 Subject: [PATCH 09/53] script: layer stroke --- scripts/layer_stroke.py | 215 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 215 insertions(+) create mode 100644 scripts/layer_stroke.py diff --git a/scripts/layer_stroke.py b/scripts/layer_stroke.py new file mode 100644 index 00000000..2daa745c --- /dev/null +++ b/scripts/layer_stroke.py @@ -0,0 +1,215 @@ +# Layer stroke +from lazpaint import dialog + +try: + from tkinter import * +except ImportError: + dialog.show_message("Please install tkinter.") + exit() + +from lazpaint import colors, image, layer, filters, tools, selection + +if layer.is_empty(): + dialog.show_message("Layer is empty") + exit() + +############ image processing + +MAX_RADIUS = 100 +MAX_OPACITY = 255 + +source_layer_id = layer.get_id() +source_layer_name = layer.get_name() + +chosen_radius = layer.get_registry("stroke-radius") +if chosen_radius == None: + chosen_radius = image.get_registry("stroke-radius") +if chosen_radius == None: + chosen_radius = 10 + +stroke_layer_id = layer.get_registry("stroke-layer-id") +if image.get_layer_index(stroke_layer_id) == None: + stroke_layer_id = None + +if stroke_layer_id is not None: + layer.select_id(stroke_layer_id) + chosen_opacity = layer.get_opacity() + overlay_color = colors.str_to_RGBA(layer.get_registry("overlay-color")) + layer.select_id(source_layer_id) +else: + chosen_opacity = layer.get_opacity() + overlay_color = None + +if overlay_color is None: + overlay_color = colors.BLACK + +def create_stroke_layer(): + global stroke_layer_id + image.do_begin() + if stroke_layer_id != None: + layer.select_id(stroke_layer_id) + stroke_index = image.get_layer_index() + selection.select_all() + selection.delete() + layer.select_id(source_layer_id) + layer.duplicate() + image.move_layer_index(image.get_layer_index(), stroke_index+1) + layer.merge_over() + else: + layer.select_id(source_layer_id) + layer.duplicate() + layer.set_name("Stroke of "+source_layer_name) + layer.set_registry("stroke-source-layer-id", source_layer_id) + stroke_layer_id = layer.get_id() + stroke_index = image.get_layer_index() + image.move_layer_index(stroke_index, stroke_index-1) + image.do_end() + +stroke_done = False +opacity_done = False +stroke_initial_color = None + +def apply_stroke(): + global stroke_done, opacity_done, stroke_initial_color + if opacity_done: + image.undo() + opacity_done = False + if stroke_done: + image.undo() + stroke_done = False + image.do_begin() + if chosen_radius > 0.5: + layer.duplicate() + disk_id = layer.get_id() + filters.blur(name=filters.BLUR_DISK, radius=chosen_radius-0.5) + filters.filter_function(red=overlay_color.red/255, green=overlay_color.green/255, blue=overlay_color.blue/255, alpha="min(alpha*"+str(chosen_radius*5)+",(1-alpha)*"+str(chosen_radius*5)+")", gamma_correction=False) + layer.select_id(stroke_layer_id) + else: + disk_id = None + filters.blur(name=filters.BLUR_CORONA, radius=chosen_radius+0.5) + filters.filter_function(red=overlay_color.red/255, green=overlay_color.green/255, blue=overlay_color.blue/255, alpha="min(alpha*"+str(chosen_radius)+",(1-alpha)*"+str(chosen_radius)+")", gamma_correction=False) + if disk_id is not None: + layer.select_id(disk_id) + layer.merge_over() + layer.set_registry("overlay-color", overlay_color) + stroke_initial_color = overlay_color + stroke_done = image.do_end() + apply_opacity() + +def apply_opacity(): + global opacity_done, chosen_opacity, overlay_color + if opacity_done: + image.undo() + opacity_done = False + image.do_begin() + layer.set_opacity(chosen_opacity) + if overlay_color != stroke_initial_color: + filters.filter_function(red=overlay_color.red/255, green=overlay_color.green/255, blue=overlay_color.blue/255, gamma_correction=False) + layer.set_registry("overlay-color", overlay_color) + opacity_done = image.do_end() + +######## interface + +def button_ok_click(): + global source_layer_id, chosen_radius, chosen_offset + layer.select_id(source_layer_id) + layer.set_registry("stroke-radius", chosen_radius) + layer.set_registry("stroke-layer-id", stroke_layer_id) + image.set_registry("stroke-radius", chosen_radius) + image.do_end() + exit() + +def button_cancel_click(): + if image.do_end(): + image.undo() + layer.select_id(source_layer_id) + exit() + +scale_radius_update_job = None + +def scale_radius_update_do(): + global scale_radius_update_job, chosen_radius, scale_radius + new_radius = scale_radius.get() + if new_radius != chosen_radius: + chosen_radius = new_radius + apply_stroke() + scale_radius_update_job = None + +def scale_radius_update(event): + global window, scale_radius_update_job + if scale_radius_update_job: + window.after_cancel(scale_radius_update_job) + scale_radius_update_job = window.after(500, scale_radius_update_do) + +scale_opacity_update_job = None + +def scale_opacity_update_do(): + global chosen_opacity + new_opacity = scale_opacity.get() + if new_opacity != chosen_opacity: + chosen_opacity = new_opacity + apply_opacity() + scale_opacity_update_job = None + +def scale_opacity_update(event): + global window, scale_opacity_update_job + if scale_opacity_update_job: + window.after_cancel(scale_opacity_update_job) + scale_opacity_update_job = window.after(100, scale_opacity_update_do) + +def button_color_click(): + global overlay_color, window + new_color = colors.show_dialog(overlay_color) + window.attributes('-topmost', True) + window.attributes('-topmost', False) + if new_color is not None and new_color != overlay_color: + overlay_color = new_color + apply_opacity() + +window = Tk() +window.title("Layer stroke") +window.resizable(False, False) + +frame = Frame(window) +frame.pack() + +label_radius = Label(frame, text="Radius:") +label_radius.grid(column=0, row=0) +scale_radius = Scale(frame, from_=0, to=MAX_RADIUS, orient=HORIZONTAL, command=scale_radius_update) +scale_radius.grid(column=1, row=0, sticky=W+E, padx=10) +scale_radius.set(chosen_radius) + +label_opacity = Label(frame, text="Opacity:") +label_opacity.grid(column=0, row=1) +scale_opacity = Scale(frame, from_=0, to=MAX_OPACITY, orient=HORIZONTAL, command=scale_opacity_update) +scale_opacity.grid(column=1, row=1, sticky=W+E, padx=10) +scale_opacity.set(chosen_opacity) + +label_color = Label(frame, text="Color:") +label_color.grid(column=0, row=2) +button_color = Button(frame, text="Color...", command=button_color_click) +button_color.grid(column=1, row=2) + +frame.columnconfigure(0, pad=20) +frame.columnconfigure(1, minsize=250) +frame.rowconfigure(0, pad=20) +frame.rowconfigure(1, pad=20) +frame.rowconfigure(2, pad=20) + +button_ok = Button(window, text="Ok", command=button_ok_click) +button_ok.pack(side=RIGHT, padx=10, pady=10) +button_cancel = Button(window, text="Cancel", command=button_cancel_click) +button_cancel.pack(side=RIGHT, pady=10) + +image.do_begin() +selection.deselect() +create_stroke_layer() +apply_stroke() + +window.update() +window_width = window.winfo_width() +screen_width = window.winfo_screenwidth() +window.geometry('+%d+0' % (int((screen_width - window_width) / 2))) + +window.mainloop() +button_cancel_click() From 5e93ea64fc3faaf5ceb4bba670108ca630b2a0d6 Mon Sep 17 00:00:00 2001 From: johann Date: Thu, 12 Mar 2020 09:54:16 +0100 Subject: [PATCH 10/53] fix release middle button --- lazpaint/lazpaintmainform.pas | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lazpaint/lazpaintmainform.pas b/lazpaint/lazpaintmainform.pas index 352dae8f..45f181c7 100644 --- a/lazpaint/lazpaintmainform.pas +++ b/lazpaint/lazpaintmainform.pas @@ -3930,6 +3930,11 @@ procedure TFMain.ReleaseMouseButtons(Shift: TShiftState); btnRightDown := false; if ToolManager.ToolUp then PaintPictureNow; end; + if not (ssMiddle in Shift) and btnMiddleDown then + begin + btnMiddleDown := false; + if ToolManager.ToolUp then PaintPictureNow; + end; if not btnLeftDown and not btnRightDown then begin CanCompressOrUpdateStack := true; From 090efd123a52f73f2752017cf5406dee81cb2a9d Mon Sep 17 00:00:00 2001 From: johann Date: Thu, 12 Mar 2020 12:10:58 +0100 Subject: [PATCH 11/53] use EqualsExactly --- lazpaint/dialog/uchoosecolorinterface.pas | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lazpaint/dialog/uchoosecolorinterface.pas b/lazpaint/dialog/uchoosecolorinterface.pas index 3852647f..5f041026 100644 --- a/lazpaint/dialog/uchoosecolorinterface.pas +++ b/lazpaint/dialog/uchoosecolorinterface.pas @@ -501,7 +501,7 @@ function TChooseColorInterface.DrawTriangleCursor(dest: TBGRABitmap; end; procedure TChooseColorInterface.DoSelect(X, Y: integer); -var pix: TBGRAPixel; +var pix, newColor: TBGRAPixel; newLight: Word; begin case FSelectZone of @@ -518,10 +518,14 @@ procedure TChooseColorInterface.DoSelect(X, Y: integer); pix := FColorCircle.bmpMaxlight.GetPixel(x-FColorCircle.Bounds.Left,y-FColorCircle.Bounds.top); if pix.alpha <> 0 then begin - FCurrentColor := BGRA(pix.Red,pix.Green,pix.Blue,FCurrentColor.Alpha); - ColorX := x-FColorCircle.Bounds.Left; - ColorY := y-FColorCircle.Bounds.top; - UpdateColorview(False, True, True); + newColor := BGRA(pix.Red,pix.Green,pix.Blue,FCurrentColor.Alpha); + if not FCurrentColor.EqualsExactly(newColor) then + begin + FCurrentColor := newColor; + ColorX := x-FColorCircle.Bounds.Left; + ColorY := y-FColorCircle.Bounds.top; + UpdateColorview(False, True, True); + end; end; end; szLightScale: @@ -980,7 +984,7 @@ procedure TChooseColorInterface.SetCurrentColor(value: TBGRAPixel; AFromEdit: bo begin newcolorlight := ColorLightOf(value); newcurrentColor := ColorWithLight(value,$FFFF); - if (newcolorlight<>FColorLight) or (newcurrentcolor <> FCurrentColor) then + if (newcolorlight<>FColorLight) or not newcurrentcolor.EqualsExactly(FCurrentColor) then begin FColorLight := newcolorlight; FCurrentColor := newcurrentcolor; From 1b5db6f3e996960cd047e5fba101cbc85170675f Mon Sep 17 00:00:00 2001 From: johann Date: Thu, 12 Mar 2020 12:45:30 +0100 Subject: [PATCH 12/53] color with alpha = 0 --- lazpaint/tools/utool.pas | 2 ++ lazpaintcontrols/lcvectorialfill.pas | 33 ++++++++++++++++--- lazpaintcontrols/lcvectorialfillinterface.pas | 6 ++-- 3 files changed, 34 insertions(+), 7 deletions(-) diff --git a/lazpaint/tools/utool.pas b/lazpaint/tools/utool.pas index 5341cf62..c95581b8 100644 --- a/lazpaint/tools/utool.pas +++ b/lazpaint/tools/utool.pas @@ -2711,9 +2711,11 @@ constructor TToolManager.Create(AImage: TLazPaintImage; AConfigProvider: IConfig RegisterScriptFunctions(True); FForeFill := TVectorialFill.Create; + FForeFill.TransparentMode := tmAlphaZeroOnly; FForeFill.SolidColor := BGRABlack; FForeFill.OnChange:=@ForeFillChange; FBackFill := TVectorialFill.Create; + FBackFill.TransparentMode := tmAlphaZeroOnly; FBackFill.SolidColor := CSSSkyBlue; FBackFill.OnChange:=@BackFillChange; FForeLastGradient:= TBGRALayerGradientOriginal.Create; diff --git a/lazpaintcontrols/lcvectorialfill.pas b/lazpaintcontrols/lcvectorialfill.pas index 92f54760..6357ab84 100644 --- a/lazpaintcontrols/lcvectorialfill.pas +++ b/lazpaintcontrols/lcvectorialfill.pas @@ -10,6 +10,7 @@ interface type TTextureRepetition = (trNone, trRepeatX, trRepeatY, trRepeatBoth); + TTransparentMode = (tmEnforeAllChannelsZero, tmAlphaZeroOnly, tmNoFill); TVectorialFillType = (vftNone, vftSolid, vftGradient, vftTexture); TVectorialFillTypes = set of TVectorialFillType; TVectorialFill = class; @@ -44,6 +45,7 @@ TVectorialFillGradientDiff = class(TCustomVectorialFillDiff) TVectorialFillDiff = class(TCustomVectorialFillDiff) protected FStart,FEnd: TVectorialFill; + FTransparentMode: TTransparentMode; public constructor Create(AFrom: TVectorialFill); procedure ComputeDiff(ATo: TVectorialFill); @@ -68,6 +70,7 @@ TVectorialFill = class FTextureRepetition: TTextureRepetition; FTextureAverageColor: TBGRAPixel; FTextureAverageColorComputed: boolean; + FTransparentMode: TTransparentMode; FGradient: TBGRALayerGradientOriginal; FOnChange: TVectorialFillChangeEvent; FOnBeforeChange: TNotifyEvent; @@ -81,6 +84,7 @@ TVectorialFill = class procedure SetTextureMatrix(AValue: TAffineMatrix); procedure SetTextureOpacity(AValue: byte); procedure SetTextureRepetition(AValue: TTextureRepetition); + procedure SetTransparentMode(AValue: TTransparentMode); procedure InternalClear; procedure BeginUpdate; procedure EndUpdate; @@ -129,6 +133,7 @@ TVectorialFill = class property TextureRepetition: TTextureRepetition read FTextureRepetition write SetTextureRepetition; property OnChange: TVectorialFillChangeEvent read FOnChange write SetOnChange; property OnBeforeChange: TNotifyEvent read FOnBeforeChange write FOnBeforeChange; + property TransparentMode: TTransparentMode read FTransparentMode write SetTransparentMode; end; implementation @@ -140,12 +145,14 @@ implementation constructor TVectorialFillDiff.Create(AFrom: TVectorialFill); begin FStart := TVectorialFill.Create; + FStart.TransparentMode:= AFrom.TransparentMode; FStart.Assign(AFrom); end; procedure TVectorialFillDiff.ComputeDiff(ATo: TVectorialFill); begin FEnd := TVectorialFill.Create; + FEnd.TransparentMode := ATo.TransparentMode; FEnd.Assign(ATo); end; @@ -401,6 +408,7 @@ procedure TVectorialFill.Init; FTextureAverageColorComputed:= false; FGradient := nil; FIsSolid := false; + FTransparentMode := tmEnforeAllChannelsZero; end; function TVectorialFill.GetIsEditable: boolean; @@ -446,6 +454,19 @@ function TVectorialFill.GetAverageColor: TBGRAPixel; end; end; +procedure TVectorialFill.SetTransparentMode(AValue: TTransparentMode); +begin + if FTransparentMode=AValue then Exit; + if (FillType = vftSolid) and (SolidColor.alpha = 0) then + begin + case FTransparentMode of + tmNoFill: Clear; + tmEnforeAllChannelsZero: SolidColor := BGRAPixelTransparent; + end; + end; + FTransparentMode:=AValue; +end; + procedure TVectorialFill.GradientChange(ASender: TObject; ABounds: PRectF; var ADiff: TBGRAOriginalDiff); var fillDiff: TVectorialFillGradientDiff; @@ -501,10 +522,14 @@ constructor TVectorialFill.CreateAsGradient( procedure TVectorialFill.SetSolid(AColor: TBGRAPixel); begin - if (FillType = vftSolid) and (SolidColor = AColor) then exit; + if AColor.alpha = 0 then + case TransparentMode of + tmNoFill: begin Clear; exit; end; + tmEnforeAllChannelsZero: AColor := BGRAPixelTransparent; + end; + if (FillType = vftSolid) and SolidColor.EqualsExactly(AColor) then exit; BeginUpdate; InternalClear; - if AColor.alpha = 0 then AColor := BGRAPixelTransparent; FColor := AColor; FIsSolid:= true; EndUpdate; @@ -635,7 +660,7 @@ function TVectorialFill.Equals(Obj: TObject): boolean; else begin case other.FillType of - vftSolid: result := (FillType = vftSolid) and (other.SolidColor = SolidColor); + vftSolid: result := (FillType = vftSolid) and other.SolidColor.EqualsExactly(SolidColor); vftGradient: result := (FillType = vftGradient) and (other.Gradient.Equals(Gradient)); vftTexture: result := (FillType = vftTexture) and (other.Texture = Texture) and (other.TextureMatrix = TextureMatrix) and (other.TextureOpacity = TextureOpacity) @@ -727,7 +752,7 @@ procedure TVectorialFill.FitGeometry(const ABox: TAffineBox); end; end; -procedure TVectorialFill.ApplyOpacity(AOpacity: byte); +procedure TVectorialFill.ApplyOpacity(AOpacity: Byte); var c: TBGRAPixel; begin diff --git a/lazpaintcontrols/lcvectorialfillinterface.pas b/lazpaintcontrols/lcvectorialfillinterface.pas index ce3f108b..808a5f0f 100644 --- a/lazpaintcontrols/lcvectorialfillinterface.pas +++ b/lazpaintcontrols/lcvectorialfillinterface.pas @@ -904,7 +904,7 @@ procedure TVectorialFillInterface.AttachMouseEvent(AControl: TImage); procedure TVectorialFillInterface.SetSolidColor(AValue: TBGRAPixel); begin - if FSolidColor=AValue then Exit; + if FSolidColor.EqualsExactly(AValue) then Exit; FSolidColor:=AValue; UpdateShapeSolidColor; If FillType = vftSolid then Changed; @@ -957,7 +957,7 @@ procedure TVectorialFillInterface.SetGradientType(AValue: TGradientType); procedure TVectorialFillInterface.SetGradEndColor(AValue: TBGRAPixel); begin - if CompareMem(@FGradEndColor,@AValue,sizeof(TBGRAPixel)) then Exit; + if FGradEndColor.EqualsExactly(AValue) then Exit; FGradEndColor:=AValue; UpdateGradientParams; if FillType = vftGradient then Changed; @@ -965,7 +965,7 @@ procedure TVectorialFillInterface.SetGradEndColor(AValue: TBGRAPixel); procedure TVectorialFillInterface.SetGradStartColor(AValue: TBGRAPixel); begin - if CompareMem(@FGradStartColor,@AValue,sizeof(TBGRAPixel)) then Exit; + if FGradStartColor.EqualsExactly(AValue) then Exit; FGradStartColor:=AValue; UpdateGradientParams; if FillType = vftGradient then Changed; From b5677d6be5c27d0750af9d2f4d7fe2a78f440290 Mon Sep 17 00:00:00 2001 From: johann Date: Thu, 12 Mar 2020 13:08:02 +0100 Subject: [PATCH 13/53] dont undock windows when going fullscreen --- lazpaint/lazpaintinstance.pas | 1 - 1 file changed, 1 deletion(-) diff --git a/lazpaint/lazpaintinstance.pas b/lazpaint/lazpaintinstance.pas index 020a6bdd..c0008250 100644 --- a/lazpaint/lazpaintinstance.pas +++ b/lazpaint/lazpaintinstance.pas @@ -1276,7 +1276,6 @@ function TLazPaintInstance.GetFullscreen: boolean; procedure TLazPaintInstance.SetFullscreen(AValue: boolean); begin if (AValue = FFullscreen) or not MainFormVisible or (FMain.WindowState = wsMinimized) then exit; - if AValue then DockLayersAndColors:= false; FFullscreen := AValue; if AValue then begin From 447904854578981b7f3f73d2df9838bb155cc178 Mon Sep 17 00:00:00 2001 From: johann Date: Thu, 12 Mar 2020 14:11:20 +0100 Subject: [PATCH 14/53] remember save file extension --- lazpaint/dialog/ubrowseimages.pas | 39 +++++++++++++++++++++++-------- lazpaint/lazpaintmainform.pas | 19 +++++++++++++-- lazpaint/ufileextensions.pas | 31 ++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 12 deletions(-) diff --git a/lazpaint/dialog/ubrowseimages.pas b/lazpaint/dialog/ubrowseimages.pas index 164087ef..cb40c869 100644 --- a/lazpaint/dialog/ubrowseimages.pas +++ b/lazpaint/dialog/ubrowseimages.pas @@ -105,6 +105,7 @@ TFBrowseImages = class(TForm) function GetInitialFilename: string; function GetOpenLayerIcon: boolean; function GetRememberStartDirectory: boolean; + procedure SetDefaultExtensions(AValue: string); procedure SetFileExtensionFilter(AValue: string); procedure SetFilterIndex(AValue: integer); procedure SetInitialFilename(AValue: string); @@ -134,6 +135,7 @@ TFBrowseImages = class(TForm) procedure SetShellMask; procedure DeleteSelectedFiles; procedure SelectFile(AName: string); + procedure SelectDefaultExtensions; procedure PreviewValidate({%H-}ASender: TObject); property CurrentFullname: string read GetCurrentFullname; property CurrentDirectory: string read GetCurrentDirectory write SetCurrentDirectory; @@ -151,7 +153,7 @@ TFBrowseImages = class(TForm) property IsSaveDialog: boolean read FIsSaveDialog write SetIsSaveDialog; property OverwritePrompt: boolean read FOverwritePrompt write FOverwritePrompt; property DefaultExtension: string read FDefaultExtension write FDefaultExtension; - property DefaultExtensions: string read FDefaultExtensions write FDefaultExtensions; + property DefaultExtensions: string read FDefaultExtensions write SetDefaultExtensions; property InitialFilename: string read GetInitialFilename write SetInitialFilename; property CurrentExtensionFilter: string read GetCurrentExtensionFilter; property Filter: string read FFileExtensionFilter write SetFileExtensionFilter; @@ -427,15 +429,6 @@ procedure TFBrowseImages.FormShow(Sender: TObject); FreeAndNil(FChosenImage.bmp); UpdatePreview; UpdateToolButtonOpen; - if (FDefaultExtensions<>'') and (ComboBox_FileExtension.ItemIndex = -1) then - begin - for i := 0 to high(FFileExtensions) do - if FFileExtensions[i] = FDefaultExtensions then - begin - ComboBox_FileExtension.ItemIndex := i; - break; - end; - end; if IsSaveDialog then begin If not AdaptExtension then @@ -761,6 +754,13 @@ function TFBrowseImages.GetRememberStartDirectory: boolean; result := CheckBox_UseDirectoryOnStartup.Checked; end; +procedure TFBrowseImages.SetDefaultExtensions(AValue: string); +begin + if FDefaultExtensions=AValue then Exit; + FDefaultExtensions:=AValue; + SelectDefaultExtensions; +end; + procedure TFBrowseImages.SetFileExtensionFilter(AValue: string); begin if FFileExtensionFilter=AValue then Exit; @@ -1129,8 +1129,12 @@ procedure TFBrowseImages.InitComboExt; ComboBox_FileExtension.Items.Add(parsedExt[i*2]); end; parsedExt.Free; + if ComboBox_FileExtension.Items.Count > 0 then + begin ComboBox_FileExtension.ItemIndex := 0; + SelectDefaultExtensions; + end; end; procedure TFBrowseImages.SetShellMask; @@ -1212,6 +1216,21 @@ procedure TFBrowseImages.SelectFile(AName: string); end; end; +procedure TFBrowseImages.SelectDefaultExtensions; +var + i: Integer; +begin + if FDefaultExtensions <> '' then + begin + for i := 0 to high(FFileExtensions) do + if FFileExtensions[i] = FDefaultExtensions then + begin + ComboBox_FileExtension.ItemIndex := i; + break; + end; + end; +end; + procedure TFBrowseImages.PreviewValidate(ASender: TObject); begin ValidateFileOrDir; diff --git a/lazpaint/lazpaintmainform.pas b/lazpaint/lazpaintmainform.pas index 45f181c7..cc2c801a 100644 --- a/lazpaint/lazpaintmainform.pas +++ b/lazpaint/lazpaintmainform.pas @@ -1032,8 +1032,13 @@ procedure TFMain.FormDestroy(Sender: TObject); FreeAndNil(FBrowseImages); FreeAndNil(FBrowseTextures); FreeAndNil(FBrowseBrushes); - if Assigned(FSaveImage) and Config.DefaultRememberSaveFormat then - Config.SetSaveExtensions(FSaveImage.DefaultExtensions); + if Config.DefaultRememberSaveFormat then + begin + if Assigned(FSaveImage) and Config.DefaultRememberSaveFormat and Config.DefaultUseImageBrowser then + Config.SetSaveExtensions(FSaveImage.DefaultExtensions) + else + Config.SetSaveExtensions(GetExtensionFilterByIndex([eoWritable], SavePictureDialog1.FilterIndex)); + end; FreeAndNil(FSaveImage); FreeAndNil(FSaveSelection); @@ -1069,6 +1074,16 @@ procedure TFMain.Init; FLoadInitialDir := Config.DefaultStartupSourceDirectory; FileRememberSaveFormat.Checked:= Config.DefaultRememberSaveFormat; + if Config.DefaultRememberSaveFormat then + begin + SavePictureDialog1.FilterIndex := GetExtensionFilterIndex([eoWritable], Config.DefaultSaveExtensions); + ExportPictureDialog.FilterIndex:= SavePictureDialog1.FilterIndex; + end else + begin + SavePictureDialog1.FilterIndex := 1; + ExportPictureDialog.FilterIndex:= 1; + end; + FImageView := TImageView.Create(LazPaintInstance, Zoom, {$IFDEF USEPAINTBOXPICTURE}PaintBox_Picture.Canvas{$ELSE}self.Canvas{$ENDIF}); diff --git a/lazpaint/ufileextensions.pas b/lazpaint/ufileextensions.pas index ba3faac4..afff608b 100644 --- a/lazpaint/ufileextensions.pas +++ b/lazpaint/ufileextensions.pas @@ -29,6 +29,8 @@ function GetSelectedFilterExtensions(const Filter: string; FilterIndex: integer; function ApplySelectedFilterExtension(const FileName: string; const Filter: string; FilterIndex: integer): string; function GetExtensionFilter(AOption: TExtensionOptions; ADisplayPrefix: string = '*.'): string; +function GetExtensionFilterIndex(AOption: TExtensionOptions; AExtensions: string): integer; +function GetExtensionFilterByIndex(AOption: TExtensionOptions; AIndex: integer): string; procedure RegisterPicExt(AName: string; AExtensionsWithoutDot: string; AOptions: TExtensionOptions); @@ -139,6 +141,35 @@ function GetExtensionFilter(AOption: TExtensionOptions; ADisplayPrefix: string = result := rsAllSupportedFiletypes + ' (' + allExtWithoutDot + ')|' + allExtFilter + result; end; +function GetExtensionFilterIndex(AOption: TExtensionOptions; AExtensions: string): integer; +var + i: Integer; +begin + result := 2; + for i := 0 to high(PictureFileExtensions) do + if (PictureFileExtensions[i].options * AOption = AOption) and + (PictureFileExtensions[i].filterForAllCases <> '') then + begin + if PictureFileExtensions[i].filterForAllCases = AExtensions then exit; + inc(result); + end; + result := 1; +end; + +function GetExtensionFilterByIndex(AOption: TExtensionOptions; AIndex: integer): string; +var curIndex, i: integer; +begin + curIndex := 2; + for i := 0 to high(PictureFileExtensions) do + if (PictureFileExtensions[i].options * AOption = AOption) and + (PictureFileExtensions[i].filterForAllCases <> '') then + begin + if curIndex = AIndex then exit(PictureFileExtensions[i].filterForAllCases); + inc(curIndex); + end; + result := '*.*'; +end; + function GetBit(Value: QWord; Index: Byte): Boolean; begin Result := ((Value shr Index) and 1) = 1; From 1ab3b580def2c0dd4cbcb4ad091c8e0961422b5a Mon Sep 17 00:00:00 2001 From: johann Date: Thu, 12 Mar 2020 18:13:28 +0100 Subject: [PATCH 15/53] darktheme for status bar --- lazpaint/umainformlayout.pas | 108 ++++++++++++++++++++--------------- 1 file changed, 61 insertions(+), 47 deletions(-) diff --git a/lazpaint/umainformlayout.pas b/lazpaint/umainformlayout.pas index ee478c21..9765f565 100644 --- a/lazpaint/umainformlayout.pas +++ b/lazpaint/umainformlayout.pas @@ -29,8 +29,9 @@ TMainFormLayout = class(TCustomMainFormLayout) FDockedToolBoxToolBar: TToolBar; FPaletteToolbar: TPaletteToolbar; FStatusBarVisible: boolean; - FStatusBar: TStatusBar; + FStatusBar: TPanel; FStatusText: string; + FStatusTextSplit: TStringList; FDarkTheme: boolean; FDockedControlsPanel: TPanel; FDockedChooseColorSplitter: TSplitter; @@ -39,6 +40,7 @@ TMainFormLayout = class(TCustomMainFormLayout) function GetStatusBarVisible: boolean; function GetStatusText: string; function GetToolBoxVisible: boolean; + procedure StatusBar_Paint(Sender: TObject); procedure ToolboxGroupMainButton_MouseMove(Sender: TObject; {%H-}Shift: TShiftState; {%H-}X, {%H-}Y: Integer); procedure SetDarkTheme(AValue: boolean); @@ -168,11 +170,16 @@ constructor TMainFormLayout.Create(AForm: TForm); FDockedControlsPanel.Anchors:= [akRight,akTop,akBottom]; FForm.InsertControl(FDockedControlsPanel); - FStatusBar := TStatusBar.Create(nil); - FStatusBar.SizeGrip := false; + FStatusBar := TPanel.Create(nil); FStatusBar.Align := alNone; FStatusBar.Visible := false; FStatusBar.Anchors := [akLeft,akRight,akBottom]; + FStatusBar.BevelOuter:= bvNone; + FStatusBar.BevelInner:= bvNone; + FStatusBar.Height := DoScaleY(15, OriginalDPI); + FStatusBar.Font.Height := -DoScaleY(12, OriginalDPI); + FStatusBar.OnPaint:=@StatusBar_Paint; + FStatusTextSplit := TStringList.Create; FForm.InsertControl(FStatusBar); ApplyTheme; @@ -182,6 +189,7 @@ destructor TMainFormLayout.Destroy; begin FreeAndNil(FDockedControlsPanel); FreeAndNil(FStatusBar); + FreeAndNil(FStatusTextSplit); FreeAndNil(FPaletteToolbar); FreeAndNil(FPanelToolBox); FreeAndNil(FMenu); @@ -209,6 +217,49 @@ function TMainFormLayout.GetToolBoxVisible: boolean; result := LazPaintInstance.ToolboxVisible; end; +procedure TMainFormLayout.StatusBar_Paint(Sender: TObject); +var + colWidth, spacing, i, x: Integer; +begin + if FStatusTextSplit.Count > 0 then + begin + spacing := DoScaleX(6, OriginalDPI); + colWidth := (FStatusBar.ClientWidth - spacing*2) div FStatusTextSplit.Count; + if colWidth > spacing*2 then + begin + if DarkTheme then + FStatusBar.Canvas.Pen.Color := clDarkPanelHighlight + else FStatusBar.Canvas.Pen.Color := clBtnHighlight; + FStatusBar.Canvas.Line(0,0, FStatusBar.Width,0); + x := 0; + for i := 0 to FStatusTextSplit.Count-1 do + begin + FStatusBar.Canvas.Font := FStatusBar.Font; + if DarkTheme then + FStatusBar.Canvas.Font.Color := clLightText + else FStatusBar.Canvas.Font.Color := clBtnText; + FStatusBar.Canvas.TextOut(x + spacing, + (FStatusBar.ClientHeight - FStatusBar.Canvas.TextHeight('Hg')) div 2, + FStatusTextSplit[i]); + + if i > 0 then + begin + if DarkTheme then + FStatusBar.Canvas.Pen.Color := clDarkPanelShadow + else FStatusBar.Canvas.Pen.Color := clBtnShadow; + FStatusBar.Canvas.Line(x-1,0, x-1,FStatusBar.Height); + if DarkTheme then + FStatusBar.Canvas.Pen.Color := clDarkPanelHighlight + else FStatusBar.Canvas.Pen.Color := clBtnHighlight; + FStatusBar.Canvas.Line(x,0, x,FStatusBar.Height); + end; + + inc(x, max(colWidth, FStatusBar.Canvas.TextWidth(FStatusTextSplit[i]) + 2*spacing)); + end; + end; + end; +end; + procedure TMainFormLayout.ToolboxGroupMainButton_MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); var @@ -256,7 +307,7 @@ function TMainFormLayout.GetStatusBarVisible: boolean; function TMainFormLayout.GetStatusText: string; begin - result := FStatusBar.SimpleText; + result := FStatusText; end; procedure TMainFormLayout.PaletteVisibilityChangedByUser(Sender: TObject); @@ -284,46 +335,13 @@ procedure TMainFormLayout.SetStatusBarVisible(AValue: boolean); end; procedure TMainFormLayout.SetStatusText(AValue: string); -var elems: TStringList; - i,w: Integer; - idxDelim: integer; begin if AValue = FStatusText then exit; FStatusText := AValue; - if pos('|',AValue) = 0 then - begin - if FStatusBar.SimplePanel <> true then - FStatusBar.SimplePanel := true; - FStatusBar.SimpleText := AValue; - end else - begin - elems := TStringList.Create; - repeat - idxDelim := pos('|',AValue); - if idxDelim = 0 then - begin - elems.Add(AValue); - break; - end; - elems.Add(copy(AValue,1,idxDelim-1)); - AValue := copy(AValue,idxDelim+1,length(AValue)-idxDelim); - until false; - if FStatusBar.SimplePanel <> false then - FStatusBar.SimplePanel := false; - while FStatusBar.Panels.Count > elems.Count do - FStatusBar.Panels.Delete(FStatusBar.Panels.Count-1); - while FStatusBar.Panels.Count < elems.Count do - with FStatusBar.Panels.Add do - Width := FStatusBar.Height*10; - w := FStatusBar.ClientWidth div elems.Count; - for i := 0 to elems.Count-1 do - with FStatusBar.Panels[i] do - begin - Text := elems[i]; - Width := w; - end; - elems.Free; - end; + FStatusTextSplit.Delimiter:= '|'; + FStatusTextSplit.StrictDelimiter:= true; + FStatusTextSplit.DelimitedText := FStatusText; + FStatusBar.Invalidate; end; procedure TMainFormLayout.SetToolBoxVisible(AValue: boolean); @@ -496,12 +514,6 @@ procedure TMainFormLayout.DoArrange; begin with GetWorkAreaAt(lsAfterDockedControlsPanel) do FStatusBar.SetBounds(Left,Bottom-FStatusBar.Height,Right-Left,FStatusBar.Height); - if not FStatusBar.SimplePanel then - begin - w := FStatusBar.ClientWidth div FStatusBar.Panels.Count; - for i := 0 to FStatusBar.Panels.Count-1 do - FStatusBar.Panels[i].Width := w; - end; if not FStatusBar.Visible then begin FStatusBar.Visible := true; @@ -522,6 +534,7 @@ procedure TMainFormLayout.ApplyTheme; FDockedToolBoxToolBar.EdgeOuter := esNone; FDockedToolBoxToolBar.OnPaint := @DarkThemeInstance.ToolBarPaint; FDockedToolBoxToolBar.OnPaintButton:= @DarkThemeInstance.ToolBarPaintButton; + FStatusBar.Color:= clDarkBtnFace; end else begin @@ -530,6 +543,7 @@ procedure TMainFormLayout.ApplyTheme; FDockedToolBoxToolBar.EdgeOuter := esNone; FDockedToolBoxToolBar.OnPaint := nil; FDockedToolBoxToolBar.OnPaintButton:= nil; + FStatusBar.Color:= clBtnFace; end; DarkThemeInstance.Apply(FDockedControlsPanel, DarkTheme, false); bevelOfs := integer(FDockedControlsPanel.BevelOuter <> bvNone)*FDockedControlsPanel.BevelWidth; From 59e02387fa7e45a63d8ad13ebf7ce9aca5efd267 Mon Sep 17 00:00:00 2001 From: johann Date: Thu, 12 Mar 2020 18:27:20 +0100 Subject: [PATCH 16/53] donate toolbutton --- lazpaint/lazpaintmainform.lfm | 34 +++++++++++++++++++++++++++++++++- lazpaint/lazpaintmainform.pas | 6 +++++- lazpaint/maintoolbar.inc | 6 ++++++ lazpaint/tools/utool.pas | 5 ++++- 4 files changed, 48 insertions(+), 3 deletions(-) diff --git a/lazpaint/lazpaintmainform.lfm b/lazpaint/lazpaintmainform.lfm index 3cb9ba0c..2341451f 100644 --- a/lazpaint/lazpaintmainform.lfm +++ b/lazpaint/lazpaintmainform.lfm @@ -214,7 +214,7 @@ object FMain: TFMain Height = 20 Hint = 'Color difference' Top = 1 - Width = 34 + Width = 36 Alignment = taCenter AutoSize = False Caption = '100%' @@ -3118,6 +3118,38 @@ object FMain: TFMain AllowedFillTypes = [vftSolid, vftGradient, vftTexture] end end + object Panel_Donate: TPanel + Left = 479 + Height = 36 + Top = 248 + Width = 44 + ClientHeight = 36 + ClientWidth = 44 + Font.Height = -12 + ParentColor = False + ParentFont = False + TabOrder = 32 + object ToolBar25: TToolBar + Left = 1 + Height = 22 + Top = 1 + Width = 24 + Align = alNone + AutoSize = True + EdgeBorders = [] + Font.Height = -12 + Images = ImageList16 + ParentFont = False + TabOrder = 0 + object ToolButton_Donate: TToolButton + Left = 1 + Hint = 'Donate...' + Top = 0 + ImageIndex = 110 + OnClick = ToolButton_DonateClick + end + end + end object ImageList16: TBGRAImageList left = 40 top = 496 diff --git a/lazpaint/lazpaintmainform.pas b/lazpaint/lazpaintmainform.pas index cc2c801a..e5771d84 100644 --- a/lazpaint/lazpaintmainform.pas +++ b/lazpaint/lazpaintmainform.pas @@ -29,6 +29,9 @@ TFMain = class(TForm) FileExport: TAction; ExportPictureDialog: TSaveDialog; MenuScript: TMenuItem; + Panel_Donate: TPanel; + ToolButton_Donate: TToolButton; + ToolBar25: TToolBar; ToolOpenedCurve: TAction; ToolPolyline: TAction; FileRunScript: TAction; @@ -536,6 +539,7 @@ TFMain = class(TForm) procedure GridNb_SpinEditChange(Sender: TObject; AByUser: boolean); procedure TimerArrangeTimer(Sender: TObject); procedure TimerHideFillTimer(Sender: TObject); + procedure ToolButton_DonateClick(Sender: TObject); procedure VectorialFill_TextureClick(Sender: TObject); procedure PaintBox_PenPreviewPaint(Sender: TObject); procedure PaintBox_PictureMouseDown(Sender: TObject; Button: TMouseButton; @@ -1178,7 +1182,7 @@ procedure TFMain.FormShow(Sender: TObject); Panel_ShapeOption,Panel_PenWidth,Panel_PenStyle,Panel_JoinStyle, Panel_CloseShape,Panel_LineCap,Panel_Aliasing, Panel_SplineStyle,Panel_Eraser,Panel_Tolerance,Panel_Text,Panel_Altitude,Panel_TextShadow,Panel_TextOutline, - Panel_PhongShape,Panel_PerspectiveOption,Panel_Brush,Panel_Ratio],Panel_ToolbarBackground); + Panel_PhongShape,Panel_PerspectiveOption,Panel_Brush,Panel_Ratio,Panel_Donate],Panel_ToolbarBackground); m.ImageList := LazPaintInstance.Icons[ScaleY(16, 96)]; m.Apply; FLayout.Menu := m; diff --git a/lazpaint/maintoolbar.inc b/lazpaint/maintoolbar.inc index 4ea3cb7c..0bc7944e 100644 --- a/lazpaint/maintoolbar.inc +++ b/lazpaint/maintoolbar.inc @@ -321,6 +321,7 @@ begin ToolManager.FillControls.Add(Panel_ColorDiff); ToolManager.BrushControls.Add(Panel_Brush); ToolManager.RatioControls.Add(Panel_Ratio); + ToolManager.DonateControls.Add(Panel_Donate); end; procedure TFMain.UpdateToolOptions; @@ -737,6 +738,11 @@ begin Panel_BackFill.Height := Panel_SwapColor.Height; end; +procedure TFMain.ToolButton_DonateClick(Sender: TObject); +begin + LazPaintInstance.Donate; +end; + procedure TFMain.SpinEdit_GridNbExit(Sender: TObject); begin if SpinEdit_GridNbX.Value < MinDeformationGridSize-1 then SpinEdit_GridNbX.Value := MinDeformationGridSize-1; diff --git a/lazpaint/tools/utool.pas b/lazpaint/tools/utool.pas index c95581b8..1c172dd2 100644 --- a/lazpaint/tools/utool.pas +++ b/lazpaint/tools/utool.pas @@ -421,7 +421,7 @@ TToolManager = class CloseShapeControls, LineCapControls, DeformationControls, TextControls, TextShadowControls, PhongControls, AltitudeControls, PerspectiveControls,FillControls, - BrushControls, RatioControls: TList; + BrushControls, RatioControls, DonateControls: TList; constructor Create(AImage: TLazPaintImage; AConfigProvider: IConfigProvider; ABitmapToVirtualScreen: TBitmapToVirtualScreenFunction = nil; @@ -2777,6 +2777,7 @@ constructor TToolManager.Create(AImage: TLazPaintImage; AConfigProvider: IConfig FillControls := TList.Create; BrushControls := TList.Create; RatioControls := TList.Create; + DonateControls := TList.Create; FCurrentToolType := ptHand; FCurrentTool := PaintTools[ptHand].Create(Self); @@ -2808,6 +2809,7 @@ destructor TToolManager.Destroy; FillControls.Free; BrushControls.Free; RatioControls.Free; + DonateControls.Free; for i := 0 to BrushCount do BrushAt[i].Free; @@ -3054,6 +3056,7 @@ function TToolManager.UpdateContextualToolbars: boolean; 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; From 368552d985b8263244acb465f072dbb5beeca553 Mon Sep 17 00:00:00 2001 From: johann Date: Thu, 12 Mar 2020 19:10:47 +0100 Subject: [PATCH 17/53] Python download button --- lazpaint/lazpainttype.pas | 14 +++++++++++++- lazpaint/release/bin/i18n/lazpaint.ar.po | 6 +++++- lazpaint/release/bin/i18n/lazpaint.bg.po | 6 +++++- lazpaint/release/bin/i18n/lazpaint.cs.po | 6 +++++- lazpaint/release/bin/i18n/lazpaint.de.po | 6 +++++- lazpaint/release/bin/i18n/lazpaint.es.po | 6 +++++- lazpaint/release/bin/i18n/lazpaint.fi.po | 6 +++++- lazpaint/release/bin/i18n/lazpaint.fr.po | 6 +++++- lazpaint/release/bin/i18n/lazpaint.ja.po | 6 +++++- lazpaint/release/bin/i18n/lazpaint.kab.po | 2 +- lazpaint/release/bin/i18n/lazpaint.lv.po | 6 +++++- lazpaint/release/bin/i18n/lazpaint.nl.po | 8 ++++++-- lazpaint/release/bin/i18n/lazpaint.po | 6 +++++- lazpaint/release/bin/i18n/lazpaint.pt_BR.po | 8 ++++++-- lazpaint/release/bin/i18n/lazpaint.ru.po | 6 +++++- lazpaint/release/bin/i18n/lazpaint.sv.po | 6 +++++- lazpaint/release/bin/i18n/lazpaint.zh_CN.po | 8 ++++++-- lazpaint/upython.pas | 4 ++-- lazpaint/uresourcestrings.pas | 3 ++- 19 files changed, 96 insertions(+), 23 deletions(-) diff --git a/lazpaint/lazpainttype.pas b/lazpaint/lazpainttype.pas index 3ff0b910..ea0deb4f 100644 --- a/lazpaint/lazpainttype.pas +++ b/lazpaint/lazpainttype.pas @@ -693,9 +693,21 @@ procedure TLazPaintCustomInstance.SetBlackAndWhite(AValue: boolean); procedure TLazPaintCustomInstance.ShowMessage(ACaption: string; AMessage: string; ADlgType: TMsgDlgType = mtInformation); var top: TTopMostInfo; + elems: TStringList; + res: TModalResult; begin top := HideTopmost; - QuestionDlg(ACaption,AMessage,ADlgType,[mrOk,rsOkay],''); + elems := TStringList.Create; + elems.Delimiter:= #9; + elems.StrictDelimiter:= true; + elems.DelimitedText:= AMessage; + if (elems.Count = 3) and (elems[1] = rsDownload) then + begin + res := QuestionDlg(ACaption,elems[0],ADlgType,[mrOk,rsDownload,mrCancel,rsCancel],''); + if res = mrOk then OpenURL(elems[2]); + end else + QuestionDlg(ACaption,AMessage,ADlgType,[mrOk,rsOkay],''); + elems.Free; ShowTopmost(top); end; diff --git a/lazpaint/release/bin/i18n/lazpaint.ar.po b/lazpaint/release/bin/i18n/lazpaint.ar.po index 0150bceb..c0d3c659 100644 --- a/lazpaint/release/bin/i18n/lazpaint.ar.po +++ b/lazpaint/release/bin/i18n/lazpaint.ar.po @@ -3112,6 +3112,10 @@ msgstr "" msgid "Information" msgstr "معلومات" +#: uresourcestrings.rsdownload +msgid "Download" +msgstr "تحميل" + #: uresourcestrings.rsintensity msgctxt "uresourcestrings.rsintensity" msgid "Intensity" @@ -3359,7 +3363,7 @@ msgid "px" msgstr "px" #: uresourcestrings.rspythonunexpectedversion -msgid "Expected python version %1 but %2 found." +msgid "Expected Python version %1 but %2 found." msgstr "" #: uresourcestrings.rsramdisk diff --git a/lazpaint/release/bin/i18n/lazpaint.bg.po b/lazpaint/release/bin/i18n/lazpaint.bg.po index 1e1b918d..7929b12e 100644 --- a/lazpaint/release/bin/i18n/lazpaint.bg.po +++ b/lazpaint/release/bin/i18n/lazpaint.bg.po @@ -3145,6 +3145,10 @@ msgstr "" msgid "Information" msgstr "" +#: uresourcestrings.rsdownload +msgid "Download" +msgstr "Изтегли" + #: uresourcestrings.rsintensity #, fuzzy msgctxt "uresourcestrings.rsintensity" @@ -3397,7 +3401,7 @@ msgid "px" msgstr "" #: uresourcestrings.rspythonunexpectedversion -msgid "Expected python version %1 but %2 found." +msgid "Expected Python version %1 but %2 found." msgstr "" #: uresourcestrings.rsramdisk diff --git a/lazpaint/release/bin/i18n/lazpaint.cs.po b/lazpaint/release/bin/i18n/lazpaint.cs.po index 4e27c77e..a25f1d18 100644 --- a/lazpaint/release/bin/i18n/lazpaint.cs.po +++ b/lazpaint/release/bin/i18n/lazpaint.cs.po @@ -3110,6 +3110,10 @@ msgstr "" msgid "Information" msgstr "Informace" +#: uresourcestrings.rsdownload +msgid "Download" +msgstr "Stažení" + #: uresourcestrings.rsintensity msgctxt "uresourcestrings.rsintensity" msgid "Intensity" @@ -3357,7 +3361,7 @@ msgid "px" msgstr "px" #: uresourcestrings.rspythonunexpectedversion -msgid "Expected python version %1 but %2 found." +msgid "Expected Python version %1 but %2 found." msgstr "" #: uresourcestrings.rsramdisk diff --git a/lazpaint/release/bin/i18n/lazpaint.de.po b/lazpaint/release/bin/i18n/lazpaint.de.po index ee9faf2b..69122b8a 100644 --- a/lazpaint/release/bin/i18n/lazpaint.de.po +++ b/lazpaint/release/bin/i18n/lazpaint.de.po @@ -3126,6 +3126,10 @@ msgstr "Unendlichkeit" msgid "Information" msgstr "Information" +#: uresourcestrings.rsdownload +msgid "Download" +msgstr "Herunterladen" + #: uresourcestrings.rsintensity msgctxt "uresourcestrings.rsintensity" msgid "Intensity" @@ -3373,7 +3377,7 @@ msgid "px" msgstr "px" #: uresourcestrings.rspythonunexpectedversion -msgid "Expected python version %1 but %2 found." +msgid "Expected Python version %1 but %2 found." msgstr "Erwartete Python-Version %1, aber %2 gefunden." #: uresourcestrings.rsramdisk diff --git a/lazpaint/release/bin/i18n/lazpaint.es.po b/lazpaint/release/bin/i18n/lazpaint.es.po index 5159d21e..46d99960 100644 --- a/lazpaint/release/bin/i18n/lazpaint.es.po +++ b/lazpaint/release/bin/i18n/lazpaint.es.po @@ -3112,6 +3112,10 @@ msgstr "Infinito" msgid "Information" msgstr "Información" +#: uresourcestrings.rsdownload +msgid "Download" +msgstr "Descargar" + #: uresourcestrings.rsintensity msgctxt "uresourcestrings.rsintensity" msgid "Intensity" @@ -3368,7 +3372,7 @@ msgid "px" msgstr "px" #: uresourcestrings.rspythonunexpectedversion -msgid "Expected python version %1 but %2 found." +msgid "Expected Python version %1 but %2 found." msgstr "Se esperaba la versión de Python %1 pero se encontró %2." #: uresourcestrings.rsramdisk diff --git a/lazpaint/release/bin/i18n/lazpaint.fi.po b/lazpaint/release/bin/i18n/lazpaint.fi.po index 8a40bb66..80412d65 100644 --- a/lazpaint/release/bin/i18n/lazpaint.fi.po +++ b/lazpaint/release/bin/i18n/lazpaint.fi.po @@ -3101,6 +3101,10 @@ msgstr "" msgid "Information" msgstr "" +#: uresourcestrings.rsdownload +msgid "Download" +msgstr "Ladata" + #: uresourcestrings.rsintensity msgctxt "uresourcestrings.rsintensity" msgid "Intensity" @@ -3348,7 +3352,7 @@ msgid "px" msgstr "" #: uresourcestrings.rspythonunexpectedversion -msgid "Expected python version %1 but %2 found." +msgid "Expected Python version %1 but %2 found." msgstr "" #: uresourcestrings.rsramdisk diff --git a/lazpaint/release/bin/i18n/lazpaint.fr.po b/lazpaint/release/bin/i18n/lazpaint.fr.po index af608b07..384ca86b 100644 --- a/lazpaint/release/bin/i18n/lazpaint.fr.po +++ b/lazpaint/release/bin/i18n/lazpaint.fr.po @@ -3122,6 +3122,10 @@ msgstr "Infinité" msgid "Information" msgstr "Informations" +#: uresourcestrings.rsdownload +msgid "Download" +msgstr "Télécharger" + #: uresourcestrings.rsintensity msgctxt "uresourcestrings.rsintensity" msgid "Intensity" @@ -3378,7 +3382,7 @@ msgid "px" msgstr "px" #: uresourcestrings.rspythonunexpectedversion -msgid "Expected python version %1 but %2 found." +msgid "Expected Python version %1 but %2 found." msgstr "Version %1 de Python attendue mais %2 trouvée." #: uresourcestrings.rsramdisk diff --git a/lazpaint/release/bin/i18n/lazpaint.ja.po b/lazpaint/release/bin/i18n/lazpaint.ja.po index c69234fe..a13988ea 100644 --- a/lazpaint/release/bin/i18n/lazpaint.ja.po +++ b/lazpaint/release/bin/i18n/lazpaint.ja.po @@ -3111,6 +3111,10 @@ msgstr "" msgid "Information" msgstr "" +#: uresourcestrings.rsdownload +msgid "Download" +msgstr "ダウンロード" + #: uresourcestrings.rsintensity msgctxt "uresourcestrings.rsintensity" msgid "Intensity" @@ -3358,7 +3362,7 @@ msgid "px" msgstr "" #: uresourcestrings.rspythonunexpectedversion -msgid "Expected python version %1 but %2 found." +msgid "Expected Python version %1 but %2 found." msgstr "" #: uresourcestrings.rsramdisk diff --git a/lazpaint/release/bin/i18n/lazpaint.kab.po b/lazpaint/release/bin/i18n/lazpaint.kab.po index 11fc8b9f..1ff60925 100644 --- a/lazpaint/release/bin/i18n/lazpaint.kab.po +++ b/lazpaint/release/bin/i18n/lazpaint.kab.po @@ -3370,7 +3370,7 @@ msgid "px" msgstr "px" #: uresourcestrings.rspythonunexpectedversion -msgid "Expected python version %1 but %2 found." +msgid "Expected Python version %1 but %2 found." msgstr "" #: uresourcestrings.rsramdisk diff --git a/lazpaint/release/bin/i18n/lazpaint.lv.po b/lazpaint/release/bin/i18n/lazpaint.lv.po index 509d7b93..46ca849e 100644 --- a/lazpaint/release/bin/i18n/lazpaint.lv.po +++ b/lazpaint/release/bin/i18n/lazpaint.lv.po @@ -3124,6 +3124,10 @@ msgstr "Bezgalība" msgid "Information" msgstr "Informācija" +#: uresourcestrings.rsdownload +msgid "Download" +msgstr "Lejupielādēt" + #: uresourcestrings.rsintensity msgctxt "uresourcestrings.rsintensity" msgid "Intensity" @@ -3382,7 +3386,7 @@ msgid "px" msgstr "pikseļi" #: uresourcestrings.rspythonunexpectedversion -msgid "Expected python version %1 but %2 found." +msgid "Expected Python version %1 but %2 found." msgstr "Pitona %1 versijas vietā atrasta %2." #: uresourcestrings.rsramdisk diff --git a/lazpaint/release/bin/i18n/lazpaint.nl.po b/lazpaint/release/bin/i18n/lazpaint.nl.po index e3e5a6aa..96465925 100644 --- a/lazpaint/release/bin/i18n/lazpaint.nl.po +++ b/lazpaint/release/bin/i18n/lazpaint.nl.po @@ -3141,6 +3141,10 @@ msgstr "Oneindigheid" msgid "Information" msgstr "Informatie" +#: uresourcestrings.rsdownload +msgid "Download" +msgstr "Downloaden" + #: uresourcestrings.rsintensity msgctxt "uresourcestrings.rsintensity" msgid "Intensity" @@ -3388,8 +3392,8 @@ msgid "px" msgstr "px" #: uresourcestrings.rspythonunexpectedversion -msgid "Expected python version %1 but %2 found." -msgstr "Verwachte python-versie %1 maar %2 gevonden." +msgid "Expected Python version %1 but %2 found." +msgstr "Verwachte Python-versie %1 maar %2 gevonden." #: uresourcestrings.rsramdisk msgid "RAM disk" diff --git a/lazpaint/release/bin/i18n/lazpaint.po b/lazpaint/release/bin/i18n/lazpaint.po index b7ecb385..6220710a 100644 --- a/lazpaint/release/bin/i18n/lazpaint.po +++ b/lazpaint/release/bin/i18n/lazpaint.po @@ -3101,6 +3101,10 @@ msgstr "" msgid "Information" msgstr "" +#: uresourcestrings.rsdownload +msgid "Download" +msgstr "" + #: uresourcestrings.rsintensity msgctxt "uresourcestrings.rsintensity" msgid "Intensity" @@ -3357,7 +3361,7 @@ msgid "px" msgstr "" #: uresourcestrings.rspythonunexpectedversion -msgid "Expected python version %1 but %2 found." +msgid "Expected Python version %1 but %2 found." msgstr "" #: uresourcestrings.rsramdisk diff --git a/lazpaint/release/bin/i18n/lazpaint.pt_BR.po b/lazpaint/release/bin/i18n/lazpaint.pt_BR.po index 248fa26a..9f7be3f8 100644 --- a/lazpaint/release/bin/i18n/lazpaint.pt_BR.po +++ b/lazpaint/release/bin/i18n/lazpaint.pt_BR.po @@ -3127,6 +3127,10 @@ msgstr "Infinidade" msgid "Information" msgstr "informações" +#: uresourcestrings.rsdownload +msgid "Download" +msgstr "Baixar" + #: uresourcestrings.rsintensity msgctxt "uresourcestrings.rsintensity" msgid "Intensity" @@ -3374,8 +3378,8 @@ msgid "px" msgstr "" #: uresourcestrings.rspythonunexpectedversion -msgid "Expected python version %1 but %2 found." -msgstr "Versão python esperada %1, mas %2 encontrada." +msgid "Expected Python version %1 but %2 found." +msgstr "Versão Python esperada %1, mas %2 encontrada." #: uresourcestrings.rsramdisk msgid "RAM disk" diff --git a/lazpaint/release/bin/i18n/lazpaint.ru.po b/lazpaint/release/bin/i18n/lazpaint.ru.po index e4f7eb8e..68349e71 100644 --- a/lazpaint/release/bin/i18n/lazpaint.ru.po +++ b/lazpaint/release/bin/i18n/lazpaint.ru.po @@ -3106,6 +3106,10 @@ msgstr "" msgid "Information" msgstr "" +#: uresourcestrings.rsdownload +msgid "Download" +msgstr "скачать" + #: uresourcestrings.rsintensity msgctxt "uresourcestrings.rsintensity" msgid "Intensity" @@ -3353,7 +3357,7 @@ msgid "px" msgstr "" #: uresourcestrings.rspythonunexpectedversion -msgid "Expected python version %1 but %2 found." +msgid "Expected Python version %1 but %2 found." msgstr "" #: uresourcestrings.rsramdisk diff --git a/lazpaint/release/bin/i18n/lazpaint.sv.po b/lazpaint/release/bin/i18n/lazpaint.sv.po index e3c3ac06..3331a29f 100644 --- a/lazpaint/release/bin/i18n/lazpaint.sv.po +++ b/lazpaint/release/bin/i18n/lazpaint.sv.po @@ -3095,6 +3095,10 @@ msgstr "Oändlig" msgid "Information" msgstr "Information" +#: uresourcestrings.rsdownload +msgid "Download" +msgstr "Ladda ner" + #: uresourcestrings.rsintensity msgctxt "uresourcestrings.rsintensity" msgid "Intensity" @@ -3342,7 +3346,7 @@ msgid "px" msgstr "px" #: uresourcestrings.rspythonunexpectedversion -msgid "Expected python version %1 but %2 found." +msgid "Expected Python version %1 but %2 found." msgstr "Python version %1 var förväntad men hittade %2." #: uresourcestrings.rsramdisk diff --git a/lazpaint/release/bin/i18n/lazpaint.zh_CN.po b/lazpaint/release/bin/i18n/lazpaint.zh_CN.po index d853b411..c34c2a39 100644 --- a/lazpaint/release/bin/i18n/lazpaint.zh_CN.po +++ b/lazpaint/release/bin/i18n/lazpaint.zh_CN.po @@ -3111,6 +3111,10 @@ msgstr "无限" msgid "Information" msgstr "信息" +#: uresourcestrings.rsdownload +msgid "Download" +msgstr "下载" + #: uresourcestrings.rsintensity msgctxt "uresourcestrings.rsintensity" msgid "Intensity" @@ -3367,8 +3371,8 @@ msgid "px" msgstr "px" #: uresourcestrings.rspythonunexpectedversion -msgid "Expected python version %1 but %2 found." -msgstr "需要 python 版本 %1 但找到 %2。" +msgid "Expected Python version %1 but %2 found." +msgstr "需要 Python 版本 %1 但找到 %2。" #: uresourcestrings.rsramdisk msgid "RAM disk" diff --git a/lazpaint/upython.pas b/lazpaint/upython.pas index d002687a..a1030441 100644 --- a/lazpaint/upython.pas +++ b/lazpaint/upython.pas @@ -200,11 +200,11 @@ procedure TPythonScript.Run(AScriptFilename: UTF8String; APythonVersion: integer); begin FLinePrefix := ''; - if PythonVersionMajor <> APythonVersion then +// if PythonVersionMajor <> APythonVersion then raise exception.Create( StringReplace( StringReplace(rsPythonUnexpectedVersion, '%1',inttostr(APythonVersion),[]), - '%2',inttostr(PythonVersionMajor),[]) ); + '%2',inttostr(PythonVersionMajor),[]) + #9 + rsDownload + #9 + 'https://www.python.org'); FFirstOutput:= true; AutomationEnvironment.Values['PYTHONPATH'] := DefaultScriptDirectory; try diff --git a/lazpaint/uresourcestrings.pas b/lazpaint/uresourcestrings.pas index 9659fd9c..02e81bdd 100644 --- a/lazpaint/uresourcestrings.pas +++ b/lazpaint/uresourcestrings.pas @@ -19,7 +19,7 @@ function CaptionToResampleFilter(AText: string): TResampleFilter; rsLazPaint = 'LazPaint'; rsScript = 'Script'; rsFunctionNotDefined = 'The function %1 is not defined.'; - rsPythonUnexpectedVersion = 'Expected python version %1 but %2 found.'; + rsPythonUnexpectedVersion = 'Expected Python version %1 but %2 found.'; rsOpening='Opening'; rsLoading='Loading'; rsRecentDirectories='Recent directories:'; @@ -180,6 +180,7 @@ function CaptionToResampleFilter(AText: string): TResampleFilter; rsCancelledByUser='Cancelled by user'; rsNoAndProceedToNext='Do not save and open another file'; rsInformation='Information'; + rsDownload='Download'; rsError='Error'; rsEndWithoutMatchingBegin = 'End without matching begin'; rsThereAreNoCheckedItems='There are no checked items. Check some items or add some new ones.'; From dc294ced4344ea4b07a9d21e8ef2ce607c2ccc6b Mon Sep 17 00:00:00 2001 From: johann Date: Thu, 12 Mar 2020 19:11:12 +0100 Subject: [PATCH 18/53] need BGRABitmap version 10.7 --- lazpaint/lazpaint.lpi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lazpaint/lazpaint.lpi b/lazpaint/lazpaint.lpi index eb45c95c..b058a85c 100644 --- a/lazpaint/lazpaint.lpi +++ b/lazpaint/lazpaint.lpi @@ -333,7 +333,7 @@ - + From e151ccd7699bbbcadd128335cb3622c6989ce606 Mon Sep 17 00:00:00 2001 From: johann Date: Thu, 12 Mar 2020 19:17:29 +0100 Subject: [PATCH 19/53] remove debug test --- lazpaint/upython.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lazpaint/upython.pas b/lazpaint/upython.pas index a1030441..2720b4f0 100644 --- a/lazpaint/upython.pas +++ b/lazpaint/upython.pas @@ -200,7 +200,7 @@ procedure TPythonScript.Run(AScriptFilename: UTF8String; APythonVersion: integer); begin FLinePrefix := ''; -// if PythonVersionMajor <> APythonVersion then + if PythonVersionMajor <> APythonVersion then raise exception.Create( StringReplace( StringReplace(rsPythonUnexpectedVersion, '%1',inttostr(APythonVersion),[]), From f1cd2c6e6da38437e711de200c098fc0ce2785f3 Mon Sep 17 00:00:00 2001 From: johann Date: Fri, 13 Mar 2020 09:34:35 +0100 Subject: [PATCH 20/53] replace by gradient if opaque --- lazpaint/tools/utoolfloodfill.pas | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lazpaint/tools/utoolfloodfill.pas b/lazpaint/tools/utoolfloodfill.pas index 53eebf6a..3dd16564 100644 --- a/lazpaint/tools/utoolfloodfill.pas +++ b/lazpaint/tools/utoolfloodfill.pas @@ -82,7 +82,8 @@ function TToolGradient.ReplaceLayerAndAddShape(out ARect: TRect): TCustomImageDi var gradientOrig: TBGRALayerCustomOriginal; begin - if Manager.Image.CurrentLayerEmpty then + if (FShape.BackFill.FillType = vftGradient) and + (Manager.Image.CurrentLayerEmpty or FShape.BackFill.Gradient.IsOpaque) then begin gradientOrig := FShape.BackFill.Gradient.Duplicate; result := TReplaceLayerByCustomOriginalDifference.Create(Manager.Image.CurrentState, From 75cfaa339382a09bd3f7d63f2fbb7fc1cb79d3ac Mon Sep 17 00:00:00 2001 From: johann Date: Fri, 13 Mar 2020 09:34:45 +0100 Subject: [PATCH 21/53] fix gradient diff --- lazpaintcontrols/lcvectorialfill.pas | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lazpaintcontrols/lcvectorialfill.pas b/lazpaintcontrols/lcvectorialfill.pas index 6357ab84..1983a0b6 100644 --- a/lazpaintcontrols/lcvectorialfill.pas +++ b/lazpaintcontrols/lcvectorialfill.pas @@ -471,9 +471,14 @@ procedure TVectorialFill.GradientChange(ASender: TObject; ABounds: PRectF; var A var fillDiff: TVectorialFillGradientDiff; begin + if Assigned(FDiff) then + begin + FreeAndNil(ADiff); + exit; + end; if Assigned(OnChange) then begin - if Assigned(FDiff) then + if Assigned(ADiff) then begin fillDiff := TVectorialFillGradientDiff.Create(ADiff as TBGRAGradientOriginalDiff); ADiff := nil; From 1858727e3d36ea3a4ff3d1936ddb25839eca085e Mon Sep 17 00:00:00 2001 From: johann Date: Fri, 13 Mar 2020 09:59:15 +0100 Subject: [PATCH 22/53] vectorial fill background --- lazpaint/image/uimageaction.pas | 42 +++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/lazpaint/image/uimageaction.pas b/lazpaint/image/uimageaction.pas index eba098b5..9983bad8 100644 --- a/lazpaint/image/uimageaction.pas +++ b/lazpaint/image/uimageaction.pas @@ -106,7 +106,7 @@ implementation uses Controls, Dialogs, UResourceStrings, UObject3D, ULoadImage, UGraph, UClipboard, Types, BGRAGradientOriginal, - BGRATransform, ULoading, math, LCVectorClipboard, LCVectorOriginal, + BGRATransform, ULoading, math, LCVectorClipboard, LCVectorOriginal, LCVectorRectShapes, BGRALayers, BGRAUTF8, UFileSystem; { TImageActions } @@ -702,21 +702,43 @@ procedure TImageActions.FillBackground(AColor: TBGRAPixel); var tempBmp: TBGRABitmap; LayerAction: TLayerAction; y: Integer; + orig: TVectorOriginal; + ab: TAffineBox; + backRect: TRectShape; begin if not Image.CheckNoAction then exit; LayerAction := nil; try - LayerAction := Image.CreateAction(True); - tempBmp := TBGRABitmap.Create(LayerAction.SelectedImageLayer.Width,1); - for y := 0 to LayerAction.SelectedImageLayer.Height-1 do + if Image.LayerOriginalClass[Image.CurrentLayerIndex] = TVectorOriginal then begin - tempBmp.Fill(AColor); - tempBmp.PutImage(0,-y,LayerAction.SelectedImageLayer,dmDrawWithTransparency); - LayerAction.SelectedImageLayer.PutImage(0,y,tempBmp,dmSet); + Image.CurrentState.DiscardOriginalDiff := false; + try + orig := Image.LayerOriginal[Image.CurrentLayerIndex] as TVectorOriginal; + backRect := TRectShape.Create(nil); + ab := AffineMatrixInverse(Image.LayerOriginalMatrix[Image.CurrentLayerIndex]) * + TAffineBox.AffineBox(rectF(-0.5, -0.5, Image.Width-0.5, Image.Height-0.5)); + backRect.Origin := ab.Center; + backRect.XAxis := backRect.Origin + (ab.TopRight - ab.TopLeft)*0.5; + backRect.YAxis := backRect.Origin + (ab.BottomLeft - ab.TopLeft)*0.5; + backRect.BackFill.SolidColor := AColor; + orig.InsertShape(backRect, 0); + finally + Image.CurrentState.DiscardOriginalDiff := true; + end; + end else + begin + LayerAction := Image.CreateAction(True); + tempBmp := TBGRABitmap.Create(LayerAction.SelectedImageLayer.Width,1); + for y := 0 to LayerAction.SelectedImageLayer.Height-1 do + begin + tempBmp.Fill(AColor); + tempBmp.PutImage(0,-y,LayerAction.SelectedImageLayer,dmDrawWithTransparency); + LayerAction.SelectedImageLayer.PutImage(0,y,tempBmp,dmSet); + end; + tempBmp.Free; + image.LayerMayChangeCompletely(LayerAction.SelectedImageLayer); + LayerAction.Validate; end; - tempBmp.Free; - image.LayerMayChangeCompletely(LayerAction.SelectedImageLayer); - LayerAction.Validate; except on ex:Exception do FInstance.ShowError('FillBackground',ex.Message); From 7c3d5754e3fdc9a304c6c6c4c25015650d5d2494 Mon Sep 17 00:00:00 2001 From: johann Date: Fri, 13 Mar 2020 10:10:08 +0100 Subject: [PATCH 23/53] image action single instance --- lazpaint/lazpaintinstance.pas | 24 ++++++++++++++---------- lazpaint/lazpaintmainform.pas | 28 ++++++++++++++++------------ lazpaint/lazpainttype.pas | 2 ++ lazpaint/ucommandline.pas | 5 +---- 4 files changed, 33 insertions(+), 26 deletions(-) diff --git a/lazpaint/lazpaintinstance.pas b/lazpaint/lazpaintinstance.pas index c0008250..9451e137 100644 --- a/lazpaint/lazpaintinstance.pas +++ b/lazpaint/lazpaintinstance.pas @@ -14,7 +14,7 @@ interface UColorintensity, UShiftColors, UColorize, uadjustcurves, UCustomblur, uimagelist, - ULoading, UImage, UTool, uconfig, IniFiles, UResourceStrings, UScripting, + ULoading, UImage, UImageAction, UTool, uconfig, IniFiles, UResourceStrings, UScripting, UScriptType; const @@ -85,6 +85,7 @@ TLazPaintInstance = class(TLazPaintCustomInstance) FGridVisible: boolean; FConfig: TLazPaintConfig; FImage: TLazPaintImage; + FImageAction: TImageActions; FToolManager : TToolManager; FEmbedded: boolean; FDestroying: boolean; @@ -138,6 +139,7 @@ TLazPaintInstance = class(TLazPaintCustomInstance) procedure SetChooseColorTarget(const AValue: TColorTarget); override; function GetConfig: TLazPaintConfig; override; function GetImage: TLazPaintImage; override; + function GetImageAction: TImageActions; override; function GetToolManager: TToolManager; override; procedure CreateLayerStack; procedure CreateToolBox; @@ -259,7 +261,7 @@ implementation URadialBlur, UMotionBlur, UEmboss, UTwirl, UWaveDisplacement, unewimage, uresample, UPixelate, unoisefilter, ufilters, - UImageAction, USharpen, uposterize, UPhongFilter, UFilterFunction, + USharpen, uposterize, UPhongFilter, UFilterFunction, uprint, USaveOption, UFormRain, ugraph, LCScaleDPI, ucommandline, uabout, UPython, UVolatileScrollBar; @@ -424,6 +426,7 @@ procedure TLazPaintInstance.Init(AEmbedded: boolean); FToolManager.OnFillChanged:= @ToolFillChanged; FSelectionEditConfig := nil; FTextureEditConfig := nil; + FImageAction := TImageActions.Create(self); end; procedure TLazPaintInstance.FormsNeeded; @@ -466,6 +469,11 @@ function TLazPaintInstance.GetImage: TLazPaintImage; Result:= FImage; end; +function TLazPaintInstance.GetImageAction: TImageActions; +begin + result := FImageAction; +end; + function TLazPaintInstance.GetToolManager: TToolManager; begin Result:= FToolManager; @@ -1109,11 +1117,9 @@ procedure TLazPaintInstance.SetChooseColorWidth(AValue: integer); end; procedure TLazPaintInstance.AssignBitmap(bmp: TBGRABitmap); -var imageActions: TimageActions; begin - imageActions := TImageActions.Create(self); - imageActions.SetCurrentBitmap(bmp.Duplicate as TBGRABitmap, False); - imageActions.Free; + if Assigned(FImageAction) then + FImageAction.SetCurrentBitmap(bmp.Duplicate as TBGRABitmap, False); end; procedure TLazPaintInstance.EditBitmap(var bmp: TBGRABitmap; ConfigStream: TStream; ATitle: String; AOnRun: TLazPaintInstanceEvent; AOnExit: TLazPaintInstanceEvent; ABlackAndWhite: boolean); @@ -1173,16 +1179,13 @@ procedure TLazPaintInstance.EditBitmap(var bmp: TBGRABitmap; ConfigStream: TStre end; procedure TLazPaintInstance.EditSelection; -var imageActions: TimageActions; begin - imageActions := TImageActions.Create(self); try - imageActions.EditSelection(@EditSelectionHandler); + TImageActions(ImageAction).EditSelection(@EditSelectionHandler); except on ex: Exception do ShowError('EditSelection',ex.Message); end; - imageActions.Free; end; function TLazPaintInstance.EditTexture(ASource: TBGRABitmap): TBGRABitmap; @@ -1393,6 +1396,7 @@ procedure TLazPaintInstance.CancelRestart; destructor TLazPaintInstance.Destroy; begin + FreeAndNil(FImageAction); RegisterScripts(False); FDestroying := true; diff --git a/lazpaint/lazpaintmainform.pas b/lazpaint/lazpaintmainform.pas index e5771d84..20dc1a1c 100644 --- a/lazpaint/lazpaintmainform.pas +++ b/lazpaint/lazpaintmainform.pas @@ -738,7 +738,6 @@ TFMain = class(TForm) FShowSelectionNormal: boolean; FLazPaintInstance: TLazPaintCustomInstance; Config: TLazPaintConfig; - FImageActions: TImageActions; StartDirectory: string; previousToolImg: integer; currentToolLabel: string; @@ -755,6 +754,7 @@ TFMain = class(TForm) function GetCurrentPressure: single; function GetDarkTheme: boolean; + function GetImageAction: TImageActions; function GetUpdatingPopup: boolean; function GetUseImageBrowser: boolean; procedure SetDarkTheme(AValue: boolean); @@ -896,6 +896,7 @@ TFMain = class(TForm) property DarkTheme: boolean read GetDarkTheme write SetDarkTheme; property Initialized: boolean read FInitialized; property UpdatingPopup: boolean read GetUpdatingPopup write SetUpdatingPopup; + property ImageAction: TImageActions read GetImageAction; end; implementation @@ -1000,7 +1001,6 @@ procedure TFMain.FormDestroy(Sender: TObject); end; FLayout.ToolBoxPopup := nil; RegisterScripts(False); - FreeAndNil(FImageActions); If Assigned(ToolManager) then begin @@ -1091,7 +1091,6 @@ procedure TFMain.Init; FImageView := TImageView.Create(LazPaintInstance, Zoom, {$IFDEF USEPAINTBOXPICTURE}PaintBox_Picture.Canvas{$ELSE}self.Canvas{$ENDIF}); - FImageActions := TImageActions.Create(LazPaintInstance); LazPaintInstance.EmbeddedResult := mrNone; Image.OnSelectedLayerIndexChanged:= @PictureSelectedLayerIndexChanged; @@ -1126,7 +1125,7 @@ procedure TFMain.Init; InitToolbarElements; Image.CurrentFilenameUTF8 := ''; - FImageActions.SetCurrentBitmap(TBGRABitmap.Create(Config.DefaultImageWidth,Config.DefaultImageHeight,Config.DefaultImageBackgroundColor), false); + ImageAction.SetCurrentBitmap(TBGRABitmap.Create(Config.DefaultImageWidth,Config.DefaultImageHeight,Config.DefaultImageBackgroundColor), false); image.ClearUndo; image.SetSavedFlag(0, -1, 0); @@ -2038,7 +2037,7 @@ procedure TFMain.FileImport3DExecute(Sender: TObject); end; if Open3DObjectDialog.Execute then begin - FImageActions.Import3DObject(Open3DObjectDialog.FileName); + ImageAction.Import3DObject(Open3DObjectDialog.FileName); Config.SetDefault3dObjectDirectory(ExtractFilePath(Open3DObjectDialog.FileName)); end; LazPaintInstance.ShowTopmost(topmostInfo); @@ -2101,7 +2100,7 @@ function TFMain.ScriptFileLoadSelection(AVars: TVariableSet): TScriptResult; end; end; end; - if FImageActions.LoadSelection(selectionFileName, @loadedImage) then + if ImageAction.LoadSelection(selectionFileName, @loadedImage) then begin FSaveSelectionInitialFilename := selectionFileName; if Assigned(Scripting.RecordingFunctionParameters) then @@ -2336,11 +2335,11 @@ procedure TFMain.FormDropFiles(Sender: TObject; const FileNames: array of String for i := 0 to high(loadedLayers) do if Assigned(loadedLayers[i].bmp) then begin - FImageActions.AddLayerFromBitmap(loadedLayers[i].bmp,ExtractFileName(loadedLayers[i].filename)); + ImageAction.AddLayerFromBitmap(loadedLayers[i].bmp,ExtractFileName(loadedLayers[i].filename)); loadedLayers[i].bmp := nil; end else begin - FImageActions.AddLayerFromOriginal(loadedLayers[i].orig,ExtractFileName(loadedLayers[i].filename)); + ImageAction.AddLayerFromOriginal(loadedLayers[i].orig,ExtractFileName(loadedLayers[i].filename)); loadedLayers[i].orig := nil; end; end; @@ -2569,13 +2568,13 @@ procedure TFMain.LayerFromFileExecute(Sender: TObject); begin if Assigned(loadedImage) and (length(chosenFiles)=1) then begin - layerLoaded := length(FImageActions.TryAddLayerFromFile(chosenFiles[0], loadedImage)) > 0; + layerLoaded := length(ImageAction.TryAddLayerFromFile(chosenFiles[0], loadedImage)) > 0; end else begin FreeAndNil(loadedImage); for i := 0 to high(chosenFiles) do begin - if length(FImageActions.TryAddLayerFromFile(chosenFiles[i])) > 0 then + if length(ImageAction.TryAddLayerFromFile(chosenFiles[i])) > 0 then layerLoaded := true; end; end; @@ -3113,7 +3112,7 @@ function TFMain.ScriptChooseTool(AVars: TVariableSet): TScriptResult; end else begin - FImageActions.RemoveSelection; + ImageAction.RemoveSelection; texMapBounds := newTexture.GetImageBounds; BGRAReplace(newTexture, newTexture.GetPart(texMapBounds)); ToolManager.BackFill.SetTexture(newTexture, AffineMatrixIdentity, @@ -3214,7 +3213,7 @@ function TFMain.ScriptChooseTool(AVars: TVariableSet): TScriptResult; mrYes: begin ToolManager.ToolCloseDontReopen; - FImageActions.RetrieveSelection; + ImageAction.RetrieveSelection; ToolManager.ToolOpen; end; end; @@ -4636,6 +4635,11 @@ function TFMain.GetDarkTheme: boolean; else result := false; end; +function TFMain.GetImageAction: TImageActions; +begin + result := TImageActions(LazPaintInstance.ImageAction); +end; + function TFMain.GetUpdatingPopup: boolean; begin result := FImageView.UpdatingPopup; diff --git a/lazpaint/lazpainttype.pas b/lazpaint/lazpainttype.pas index ea0deb4f..f665579e 100644 --- a/lazpaint/lazpainttype.pas +++ b/lazpaint/lazpainttype.pas @@ -174,6 +174,7 @@ TLazPaintCustomInstance = class(TInterfacedObject,IConfigProvider) function GetConfig: TLazPaintConfig; virtual; abstract; function GetImage: TLazPaintImage; virtual; abstract; + function GetImageAction: TObject; virtual; abstract; function GetToolManager: TToolManager; virtual; abstract; procedure SetBlackAndWhite(AValue: boolean); virtual; function GetZoomFactor: single; virtual; @@ -321,6 +322,7 @@ TLazPaintCustomInstance = class(TInterfacedObject,IConfigProvider) property ChooseColorTarget: TColorTarget read GetChooseColorTarget write setChooseColorTarget; property Config: TLazPaintConfig read GetConfig; property Image: TLazPaintImage read GetImage; + property ImageAction: TObject read GetImageAction; property ZoomFactor: single read GetZoomFactor; property ToolManager: TToolManager read GetToolManager; property Embedded: boolean read GetEmbedded; diff --git a/lazpaint/ucommandline.pas b/lazpaint/ucommandline.pas index f35c2a85..e8430982 100644 --- a/lazpaint/ucommandline.pas +++ b/lazpaint/ucommandline.pas @@ -278,11 +278,8 @@ procedure InternalProcessCommands(instance: TLazPaintCustomInstance; commandsUTF procedure ProcessCommands(instance: TLazPaintCustomInstance; commandsUTF8: TStringList; out errorEncountered, fileSaved, quitQuery: boolean); -var imageActions: TImageActions; begin - imageActions := TImageActions.Create(instance); - InternalProcessCommands(instance, commandsUTF8, errorEncountered, fileSaved, quitQuery, imageActions); - imageActions.Free; + InternalProcessCommands(instance, commandsUTF8, errorEncountered, fileSaved, quitQuery, TImageActions(instance.ImageAction)); end; end. From ab9b412d9002bd424978988f7e2a2b83d79de37b Mon Sep 17 00:00:00 2001 From: johann Date: Fri, 13 Mar 2020 12:28:57 +0100 Subject: [PATCH 24/53] floodfill with solid color preserve vectors --- lazpaint/tools/utool.pas | 1 + lazpaint/tools/utoolfloodfill.pas | 128 +++++++++++++++++------- lazpaintcontrols/lcvectororiginal.pas | 12 +++ lazpaintcontrols/lcvectorpolyshapes.pas | 34 +++++++ lazpaintcontrols/lcvectorrectshapes.pas | 82 +++++++++++++++ lazpaintcontrols/lcvectortextshapes.pas | 19 +++- 6 files changed, 241 insertions(+), 35 deletions(-) diff --git a/lazpaint/tools/utool.pas b/lazpaint/tools/utool.pas index 1c172dd2..4cf4887f 100644 --- a/lazpaint/tools/utool.pas +++ b/lazpaint/tools/utool.pas @@ -484,6 +484,7 @@ TToolManager = class 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; diff --git a/lazpaint/tools/utoolfloodfill.pas b/lazpaint/tools/utoolfloodfill.pas index 3dd16564..56b9b108 100644 --- a/lazpaint/tools/utoolfloodfill.pas +++ b/lazpaint/tools/utoolfloodfill.pas @@ -40,7 +40,7 @@ TToolGradient = class(TVectorialTool) implementation uses ugraph, LazPaintType, BGRAGradientScanner, LCVectorRectShapes, - BGRATransform, UImageDiff, BGRAPen; + BGRATransform, UImageDiff, BGRAPen, UScripting, BGRABlend; { TToolGradient } @@ -124,47 +124,107 @@ function TToolFloodFill.DoToolDown(toolDest: TBGRABitmap; pt: TPoint; diff: TCustomImageDifference; rectShape: TRectShape; homogeneous: Boolean; + params: TVariableSet; + vectOrig: TVectorOriginal; + i: Integer; + ptOrig: TPointF; + newColor: TBGRAPixel; begin + result := OnlyRenderChange; homogeneous := toolDest.Equals(toolDest.GetPixel(0,0)); - if Manager.Image.SelectionMaskEmpty and homogeneous then + if Manager.Image.SelectionMaskEmpty then begin - CancelAction; - if rightBtn then f := Manager.BackFill.Duplicate - else f := Manager.ForeFill.Duplicate; - try - f.ApplyOpacity(Manager.GetPressureB); - f.FitGeometry(SuggestGradientBox); - case f.FillType of - vftGradient: orig := f.Gradient.Duplicate; - else + if homogeneous then + begin + CancelAction; + if rightBtn then f := Manager.BackFill.Duplicate + else f := Manager.ForeFill.Duplicate; + try + f.ApplyOpacity(Manager.GetPressureB); + f.FitGeometry(SuggestGradientBox); + case f.FillType of + vftGradient: orig := f.Gradient.Duplicate; + else + begin + orig := TVectorOriginal.Create; + rectShape := TRectShape.Create(nil); + rectShape.QuickDefine(PointF(-0.5,-0.5), PointF(Manager.Image.Width-0.5,Manager.Image.Height-0.5)); + rectShape.PenStyle := ClearPenStyle; + rectShape.BackFill.Assign(f); + TVectorOriginal(orig).AddShape(rectShape); + end; + end; + diff := TReplaceLayerByCustomOriginalDifference.Create(Manager.Image.CurrentState, + Manager.Image.CurrentLayerIndex, false, orig); + Manager.Image.AddUndo(diff); + Manager.Image.ImageMayChangeCompletely; + finally + f.Free; + end; + exit; + end else + if GetCurrentLayerKind = lkVectorial then + begin + if rightBtn then f := Manager.BackFill else f := Manager.ForeFill; + if f.FillType = vftSolid then + begin + vectOrig := TVectorOriginal(Manager.Image.LayerOriginal[Manager.Image.CurrentLayerIndex]); + ptOrig := AffineMatrixInverse(Manager.Image.LayerOriginalMatrix[Manager.Image.CurrentLayerIndex]) * ptF; + for i := vectOrig.ShapeCount-1 downto 0 do + begin + if (vsfPenFill in vectOrig.Shape[i].Fields) and + vectOrig.Shape[i].PointInPen(ptOrig) then + begin + if not (vectOrig.Shape[i].PenFill.FillType = vftSolid) then break; + CancelAction; + Manager.Image.CurrentState.DiscardOriginalDiff:= false; + try + newColor := vectOrig.Shape[i].PenFill.SolidColor; + DrawPixelsInline(@newColor, f.SolidColor, 1); + vectOrig.Shape[i].PenFill.SetSolid(newColor); + finally + Manager.Image.CurrentState.DiscardOriginalDiff:= true; + end; + exit; + end; + if (vsfBackFill in vectOrig.Shape[i].Fields) and + vectOrig.Shape[i].PointInBack(ptOrig) then + begin + if not (vectOrig.Shape[i].BackFill.FillType = vftSolid) then break; + CancelAction; + Manager.Image.CurrentState.DiscardOriginalDiff:= false; + try + newColor := vectOrig.Shape[i].BackFill.SolidColor; + DrawPixelsInline(@newColor, f.SolidColor, 1); + vectOrig.Shape[i].BackFill.SetSolid(newColor); + finally + Manager.Image.CurrentState.DiscardOriginalDiff:= true; + end; + exit; + end; + end; + if (toolDest.GetPixel(pt.X,pt.Y).alpha = 0) + and Assigned(Manager.Scripting) then begin - orig := TVectorOriginal.Create; - rectShape := TRectShape.Create(nil); - rectShape.QuickDefine(PointF(-0.5,-0.5), PointF(Manager.Image.Width-0.5,Manager.Image.Height-0.5)); - rectShape.PenStyle := ClearPenStyle; - rectShape.BackFill.Assign(f); - TVectorOriginal(orig).AddShape(rectShape); + CancelAction; + params := TVariableSet.Create('ImageFillBackground'); + params.Pixels['BackColor'] := f.SolidColor; + Manager.Scripting.CallScriptFunction(params); + params.Free; + exit; end; end; - diff := TReplaceLayerByCustomOriginalDifference.Create(Manager.Image.CurrentState, - Manager.Image.CurrentLayerIndex, false, orig); - Manager.Image.AddUndo(diff); - Manager.Image.ImageMayChangeCompletely; - finally - f.Free; end; - end else - begin - if rightBtn then b := GetBackUniversalBrush - else b := GetForeUniversalBrush; - if homogeneous then toolDest.Fill(b) - else toolDest.FloodFill(pt.X, pt.Y, b, - ffProgressive in Manager.FloodFillOptions, Manager.Tolerance*$101); - ReleaseUniversalBrushes; - Action.NotifyChange(toolDest, rect(0,0,toolDest.Width,toolDest.Height)); - ValidateAction; end; - result := OnlyRenderChange; + + if rightBtn then b := GetBackUniversalBrush + else b := GetForeUniversalBrush; + if homogeneous then toolDest.Fill(b) + else toolDest.FloodFill(pt.X, pt.Y, b, + ffProgressive in Manager.FloodFillOptions, Manager.Tolerance*$101); + ReleaseUniversalBrushes; + Action.NotifyChange(toolDest, rect(0,0,toolDest.Width,toolDest.Height)); + ValidateAction; end; function TToolFloodFill.GetContextualToolbars: TContextualToolbars; diff --git a/lazpaintcontrols/lcvectororiginal.pas b/lazpaintcontrols/lcvectororiginal.pas index 88f000f3..cd0417c5 100644 --- a/lazpaintcontrols/lcvectororiginal.pas +++ b/lazpaintcontrols/lcvectororiginal.pas @@ -218,6 +218,8 @@ TVectorShape = class function SuggestGradientBox(AMatrix: TAffineMatrix): TAffineBox; virtual; function PointInShape(APoint: TPointF): boolean; overload; virtual; abstract; function PointInShape(APoint: TPointF; ARadius: single): boolean; overload; virtual; abstract; + function PointInBack(APoint: TPointF): boolean; overload; virtual; + function PointInPen(APoint: TPointF): boolean; overload; virtual; procedure ConfigureCustomEditor(AEditor: TBGRAOriginalEditor); virtual; abstract; procedure ConfigureEditor(AEditor: TBGRAOriginalEditor); virtual; procedure LoadFromStorage(AStorage: TBGRACustomOriginalStorage); virtual; @@ -1960,6 +1962,16 @@ function TVectorShape.SuggestGradientBox(AMatrix: TAffineMatrix): TAffineBox; result := TAffineBox.AffineBox(rF); end; +function TVectorShape.PointInBack(APoint: TPointF): boolean; +begin + result := false; +end; + +function TVectorShape.PointInPen(APoint: TPointF): boolean; +begin + result := false; +end; + procedure TVectorShape.ConfigureEditor(AEditor: TBGRAOriginalEditor); begin if (Usermode = vsuEditBackFill) and BackFill.IsEditable then diff --git a/lazpaintcontrols/lcvectorpolyshapes.pas b/lazpaintcontrols/lcvectorpolyshapes.pas index 5f603a70..fe8d64f9 100644 --- a/lazpaintcontrols/lcvectorpolyshapes.pas +++ b/lazpaintcontrols/lcvectorpolyshapes.pas @@ -145,6 +145,8 @@ TPolylineShape = class(TCustomPolypointShape) function GetRenderBounds({%H-}ADestRect: TRect; AMatrix: TAffineMatrix; AOptions: TRenderBoundsOptions = []): TRectF; override; function PointInShape(APoint: TPointF): boolean; overload; override; function PointInShape(APoint: TPointF; ARadius: single): boolean; overload; override; + function PointInBack(APoint: TPointF): boolean; overload; override; + function PointInPen(APoint: TPointF): boolean; overload; override; function GetIsSlow(const {%H-}AMatrix: TAffineMatrix): boolean; override; class function StorageClassName: RawByteString; override; end; @@ -1288,6 +1290,38 @@ function TPolylineShape.PointInShape(APoint: TPointF; ARadius: single): boolean; result := IsPointInPolygon(pts, APoint, true); end; +function TPolylineShape.PointInBack(APoint: TPointF): boolean; +var + pts: ArrayOfTPointF; + scan: TBGRACustomScanner; +begin + if BackVisible then + begin + pts := GetCurve(AffineMatrixIdentity); + result := IsPointInPolygon(pts, APoint, true); + if result and (BackFill.FillType = vftTexture) then + begin + scan := BackFill.CreateScanner(AffineMatrixIdentity, false); + if scan.ScanAt(APoint.X,APoint.Y).alpha = 0 then result := false; + scan.Free; + end; + end else + result := false; +end; + +function TPolylineShape.PointInPen(APoint: TPointF): boolean; +var + pts: ArrayOfTPointF; +begin + if BackVisible then + begin + pts := GetCurve(AffineMatrixIdentity); + pts := ComputeStroke(pts, Closed, AffineMatrixIdentity); + result := IsPointInPolygon(pts, APoint, true); + end else + result := false; +end; + function TPolylineShape.GetIsSlow(const AMatrix: TAffineMatrix): boolean; var pts: ArrayOfTPointF; i: Integer; diff --git a/lazpaintcontrols/lcvectorrectshapes.pas b/lazpaintcontrols/lcvectorrectshapes.pas index 6477e1df..e63a7065 100644 --- a/lazpaintcontrols/lcvectorrectshapes.pas +++ b/lazpaintcontrols/lcvectorrectshapes.pas @@ -105,6 +105,8 @@ TRectShape = class(TCustomRectShape) function GetRenderBounds({%H-}ADestRect: TRect; AMatrix: TAffineMatrix; AOptions: TRenderBoundsOptions = []): TRectF; override; function PointInShape(APoint: TPointF): boolean; overload; override; function PointInShape(APoint: TPointF; ARadius: single): boolean; overload; override; + function PointInBack(APoint: TPointF): boolean; overload; override; + function PointInPen(APoint: TPointF): boolean; overload; override; function GetIsSlow(const AMatrix: TAffineMatrix): boolean; override; class function StorageClassName: RawByteString; override; end; @@ -124,6 +126,8 @@ TEllipseShape = class(TCustomRectShape) function GetRenderBounds({%H-}ADestRect: TRect; AMatrix: TAffineMatrix; AOptions: TRenderBoundsOptions = []): TRectF; override; function PointInShape(APoint: TPointF): boolean; overload; override; function PointInShape(APoint: TPointF; ARadius: single): boolean; overload; override; + function PointInBack(APoint: TPointF): boolean; overload; override; + function PointInPen(APoint: TPointF): boolean; overload; override; function GetIsSlow(const AMatrix: TAffineMatrix): boolean; override; class function StorageClassName: RawByteString; override; end; @@ -190,6 +194,7 @@ TPhongShape = class(TCustomRectShape) function GetRenderBounds({%H-}ADestRect: TRect; AMatrix: TAffineMatrix; AOptions: TRenderBoundsOptions = []): TRectF; override; function PointInShape(APoint: TPointF): boolean; overload; override; function PointInShape(APoint: TPointF; ARadius: single): boolean; overload; override; + function PointInBack(APoint: TPointF): boolean; overload; override; function GetIsSlow(const AMatrix: TAffineMatrix): boolean; override; function GetGenericCost: integer; override; procedure Transform(const AMatrix: TAffineMatrix); override; @@ -1111,6 +1116,38 @@ function TRectShape.PointInShape(APoint: TPointF; ARadius: single): boolean; else result := false; end; +function TRectShape.PointInBack(APoint: TPointF): boolean; +var + box: TAffineBox; + scan: TBGRACustomScanner; +begin + if BackVisible then + begin + box := GetAffineBox(AffineMatrixIdentity, true); + result := box.Contains(APoint); + if result and (BackFill.FillType = vftTexture) then + begin + scan := BackFill.CreateScanner(AffineMatrixIdentity, false); + if scan.ScanAt(APoint.X,APoint.Y).alpha = 0 then result := false; + scan.Free; + end; + end else + result := false; +end; + +function TRectShape.PointInPen(APoint: TPointF): boolean; +var + pts: ArrayOfTPointF; +begin + if PenVisible then + begin + pts := GetAffineBox(AffineMatrixIdentity, true).AsPolygon; + pts := ComputeStroke(pts,true, AffineMatrixIdentity); + result:= IsPointInPolygon(pts, APoint, true); + end else + result := false; +end; + class function TRectShape.StorageClassName: RawByteString; begin result := 'rect'; @@ -1356,6 +1393,38 @@ function TEllipseShape.PointInShape(APoint: TPointF; ARadius: single): boolean; result := false; end; +function TEllipseShape.PointInBack(APoint: TPointF): boolean; +var + pts: ArrayOfTPointF; + scan: TBGRACustomScanner; +begin + if BackVisible then + begin + pts := ComputeEllipse(FOrigin, FXAxis, FYAxis); + result:= IsPointInPolygon(pts, APoint, true); + if result and (BackFill.FillType = vftTexture) then + begin + scan := BackFill.CreateScanner(AffineMatrixIdentity, false); + if scan.ScanAt(APoint.X,APoint.Y).alpha = 0 then result := false; + scan.Free; + end; + end else + result := false; +end; + +function TEllipseShape.PointInPen(APoint: TPointF): boolean; +var + pts: ArrayOfTPointF; +begin + if PenVisible then + begin + pts := ComputeEllipse(FOrigin, FXAxis, FYAxis); + pts := ComputeStroke(pts,true, AffineMatrixIdentity); + result:= IsPointInPolygon(pts, APoint, true); + end else + result := false; +end; + function TEllipseShape.GetIsSlow(const AMatrix: TAffineMatrix): boolean; var ab: TAffineBox; @@ -1760,6 +1829,19 @@ function TPhongShape.PointInShape(APoint: TPointF; ARadius: single): boolean; else result := false; end; +function TPhongShape.PointInBack(APoint: TPointF): boolean; +var + scan: TBGRACustomScanner; +begin + result := PointInShape(APoint); + if result and (BackFill.FillType = vftTexture) then + begin + scan := BackFill.CreateScanner(AffineMatrixIdentity, false); + if scan.ScanAt(APoint.X,APoint.Y).alpha = 0 then result := false; + scan.Free; + end; +end; + function TPhongShape.GetIsSlow(const AMatrix: TAffineMatrix): boolean; var ab: TAffineBox; diff --git a/lazpaintcontrols/lcvectortextshapes.pas b/lazpaintcontrols/lcvectortextshapes.pas index 8df7cb15..cf829fa6 100644 --- a/lazpaintcontrols/lcvectortextshapes.pas +++ b/lazpaintcontrols/lcvectortextshapes.pas @@ -157,6 +157,7 @@ TTextShape = class(TCustomRectShape) function GetRenderBounds({%H-}ADestRect: TRect; AMatrix: TAffineMatrix; AOptions: TRenderBoundsOptions = []): TRectF; override; function PointInShape(APoint: TPointF): boolean; overload; override; function PointInShape({%H-}APoint: TPointF; {%H-}ARadius: single): boolean; overload; override; + function PointInPen(APoint: TPointF): boolean; overload; override; function GetIsSlow(const {%H-}AMatrix: TAffineMatrix): boolean; override; function GetGenericCost: integer; override; procedure MouseMove({%H-}Shift: TShiftState; {%H-}X, {%H-}Y: single; var {%H-}ACursor: TOriginalEditorCursor; var {%H-}AHandled: boolean); override; @@ -198,7 +199,7 @@ implementation uses BGRATransform, BGRAText, BGRAVectorize, LCVectorialFill, math, BGRAUTF8, BGRAUnicode, Graphics, Clipbrd, LCLType, LCLIntf, - BGRAGradients, BGRACustomTextFX, LCResourceString; + BGRAGradients, BGRACustomTextFX, LCResourceString, BGRAFillInfo; function FontStyleToStr(AStyle: TFontStyles): string; begin @@ -1497,6 +1498,22 @@ function TTextShape.PointInShape(APoint: TPointF; ARadius: single): boolean; result := false; end; +function TTextShape.PointInPen(APoint: TPointF): boolean; +var + tl: TBidiTextLayout; + pt: TPointF; + i: Integer; +begin + if not GetAffineBox(AffineMatrixIdentity,true).Contains(APoint) then + exit(false); + SetGlobalMatrix(AffineMatrixIdentity); + tl := GetTextLayout; + pt := AffineMatrixInverse(GetUntransformedMatrix)*APoint; + for i := 0 to tl.PartCount-1 do + if tl.PartAffineBox[i].Contains(pt) then exit(true); + result := false; +end; + function TTextShape.GetIsSlow(const AMatrix: TAffineMatrix): boolean; begin Result:= true; From c3b0afc0dad232590e03d8220521a88944368230 Mon Sep 17 00:00:00 2001 From: johann Date: Fri, 13 Mar 2020 20:02:23 +0100 Subject: [PATCH 25/53] multishape draft --- lazpaintcontrols/lazpaintcontrols.lpk | 6 +- lazpaintcontrols/lazpaintcontrols.pas | 2 +- lazpaintcontrols/lcvectormultishape.pas | 222 ++++++++++++++++++++++++ lazpaintcontrols/lcvectororiginal.pas | 28 ++- lazpaintcontrols/lcvectorpolyshapes.pas | 7 +- lazpaintcontrols/lcvectorrectshapes.pas | 40 ++--- lazpaintcontrols/lcvectortextshapes.pas | 4 +- 7 files changed, 271 insertions(+), 38 deletions(-) create mode 100644 lazpaintcontrols/lcvectormultishape.pas diff --git a/lazpaintcontrols/lazpaintcontrols.lpk b/lazpaintcontrols/lazpaintcontrols.lpk index bf4ce3f8..d63ab08d 100644 --- a/lazpaintcontrols/lazpaintcontrols.lpk +++ b/lazpaintcontrols/lazpaintcontrols.lpk @@ -21,7 +21,7 @@ - + @@ -71,6 +71,10 @@ + + + + diff --git a/lazpaintcontrols/lazpaintcontrols.pas b/lazpaintcontrols/lazpaintcontrols.pas index 9e462b40..6a681e7c 100644 --- a/lazpaintcontrols/lazpaintcontrols.pas +++ b/lazpaintcontrols/lazpaintcontrols.pas @@ -11,7 +11,7 @@ interface LCToolbars, LCVectorialFill, LCVectorialFillInterface, LCVectorOriginal, LCVectorPolyShapes, LCVectorRectShapes, LCVectorialFillControl, LCVectorShapes, LCVectorTextShapes, LCScaleDPI, LCVectorClipboard, - LCResourceString, LazarusPackageIntf; + LCResourceString, LCVectorMultishape, LazarusPackageIntf; implementation diff --git a/lazpaintcontrols/lcvectormultishape.pas b/lazpaintcontrols/lcvectormultishape.pas new file mode 100644 index 00000000..a3b44bf8 --- /dev/null +++ b/lazpaintcontrols/lcvectormultishape.pas @@ -0,0 +1,222 @@ +unit LCVectorMultishape; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, LCVectorRectShapes, LCVectorOriginal, BGRALayerOriginal, + BGRATransform, BGRABitmap, BGRABitmapTypes; + +type + + { TVectorMultishape } + + TVectorMultishape = class(TCustomRectShape) + protected + FShapes: TVectorShapes; + function GetCornerPositition: single; override; + public + constructor Create(AContainer: TVectorOriginal); override; + procedure Clear; + procedure AddShape(AShape: TVectorShape); + procedure RemoveShape(AShape: TVectorShape); + function MultiFields: TVectorShapeFields; + procedure TransformFrame(const AMatrix: TAffineMatrix); override; + procedure TransformFill(const AMatrix: TAffineMatrix; ABackOnly: boolean); override; + function AllowShearTransform: boolean; override; + procedure LoadFromStorage(AStorage: TBGRACustomOriginalStorage); override; + procedure SaveToStorage(AStorage: TBGRACustomOriginalStorage); override; + procedure Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; ADraft: boolean); overload; override; + procedure Render(ADest: TBGRABitmap; ARenderOffset: TPoint; AMatrix: TAffineMatrix; ADraft: boolean); overload; override; + function GetRenderBounds({%H-}ADestRect: TRect; AMatrix: TAffineMatrix; {%H-}AOptions: TRenderBoundsOptions = []): TRectF; override; + procedure ConfigureCustomEditor(AEditor: TBGRAOriginalEditor); override; + function PointInShape(APoint: TPointF): boolean; overload; override; + function PointInShape(APoint: TPointF; ARadius: single): boolean; overload; override; + function PointInBack(APoint: TPointF): boolean; overload; override; + function PointInPen(APoint: TPointF): boolean; overload; override; + function GetIsSlow(const AMatrix: TAffineMatrix): boolean; override; + class function StorageClassName: RawByteString; override; + destructor Destroy; override; + end; + +implementation + +{ TVectorMultishape } + +procedure TVectorMultishape.TransformFill(const AMatrix: TAffineMatrix; + ABackOnly: boolean); +var + i: Integer; +begin + BeginUpdate; + for i := 0 to FShapes.Count-1 do + FShapes[i].TransformFill(AMatrix, ABackOnly); + EndUpdate; +end; + +function TVectorMultishape.GetCornerPositition: single; +begin + result := 1; +end; + +function TVectorMultishape.AllowShearTransform: boolean; +var + i: Integer; +begin + for i := 0 to FShapes.Count-1 do + if not FShapes[i].AllowShearTransform then exit(false); + result := true; +end; + +procedure TVectorMultishape.LoadFromStorage(AStorage: TBGRACustomOriginalStorage); +begin + raise exception.Create('Cannot be deserialized'); +end; + +procedure TVectorMultishape.SaveToStorage(AStorage: TBGRACustomOriginalStorage); +begin + raise exception.Create('Cannot be serialized'); +end; + +procedure TVectorMultishape.Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; + ADraft: boolean); +var + i: Integer; +begin + for i := 0 to FShapes.Count-1 do + FShapes[i].Render(ADest, AMatrix, ADraft); +end; + +procedure TVectorMultishape.Render(ADest: TBGRABitmap; ARenderOffset: TPoint; + AMatrix: TAffineMatrix; ADraft: boolean); +var + i: Integer; +begin + for i := 0 to FShapes.Count-1 do + FShapes[i].Render(ADest, ARenderOffset, AMatrix, ADraft); +end; + +function TVectorMultishape.GetRenderBounds(ADestRect: TRect; + AMatrix: TAffineMatrix; AOptions: TRenderBoundsOptions): TRectF; +var + i: Integer; +begin + result := EmptyRectF; + for i := 0 to FShapes.Count-1 do + result := result.Union(FShapes[i].GetRenderBounds(ADestRect, AMatrix, AOptions), true); +end; + +procedure TVectorMultishape.ConfigureCustomEditor(AEditor: TBGRAOriginalEditor); +var + i: Integer; + ab: TAffineBox; +begin + for i := 0 to FShapes.Count-1 do + begin + ab := FShapes[i].SuggestGradientBox(AffineMatrixIdentity); + AEditor.AddPolyline(ab.AsPolygon, true, opsDash); + end; + inherited ConfigureCustomEditor(AEditor); +end; + +function TVectorMultishape.PointInShape(APoint: TPointF): boolean; +var + i: LongInt; +begin + for i := FShapes.Count-1 downto 0 do + if FShapes[i].PointInShape(APoint) then exit(true); + result := false; +end; + +function TVectorMultishape.PointInShape(APoint: TPointF; ARadius: single): boolean; +var + i: LongInt; +begin + for i := FShapes.Count-1 downto 0 do + if FShapes[i].PointInShape(APoint, ARadius) then exit(true); + result := false; +end; + +function TVectorMultishape.PointInBack(APoint: TPointF): boolean; +var + i: LongInt; +begin + for i := FShapes.Count-1 downto 0 do + if FShapes[i].PointInBack(APoint) then exit(true); + result := false; +end; + +function TVectorMultishape.PointInPen(APoint: TPointF): boolean; +var + i: LongInt; +begin + for i := FShapes.Count-1 downto 0 do + if FShapes[i].PointInPen(APoint) then exit(true); + result := false; +end; + +function TVectorMultishape.GetIsSlow(const AMatrix: TAffineMatrix): boolean; +var + i: LongInt; +begin + if FShapes.Count >= 5 then exit(true); + for i := 0 to FShapes.Count-1 do + if FShapes[i].GetIsSlow(AMatrix) then exit(true); + result := false; +end; + +class function TVectorMultishape.StorageClassName: RawByteString; +begin + result := 'multishape'; +end; + +procedure TVectorMultishape.Clear; +begin + FShapes.Clear; +end; + +procedure TVectorMultishape.AddShape(AShape: TVectorShape); +begin + FShapes.Add(AShape); +end; + +procedure TVectorMultishape.RemoveShape(AShape: TVectorShape); +begin + FShapes.Remove(AShape); +end; + +function TVectorMultishape.MultiFields: TVectorShapeFields; +var + i: Integer; +begin + result := []; + for i := 0 to FShapes.Count-1 do + result += FShapes[i].Fields; +end; + +constructor TVectorMultishape.Create(AContainer: TVectorOriginal); +begin + inherited Create(AContainer); + FShapes := TVectorShapes.Create; +end; + +procedure TVectorMultishape.TransformFrame(const AMatrix: TAffineMatrix); +var + i: Integer; +begin + BeginUpdate; + for i := 0 to FShapes.Count-1 do + FShapes[i].TransformFrame(AMatrix); + EndUpdate; +end; + +destructor TVectorMultishape.Destroy; +begin + Clear; + FShapes.Free; + inherited Destroy; +end; + +end. + diff --git a/lazpaintcontrols/lcvectororiginal.pas b/lazpaintcontrols/lcvectororiginal.pas index cd0417c5..ba235903 100644 --- a/lazpaintcontrols/lcvectororiginal.pas +++ b/lazpaintcontrols/lcvectororiginal.pas @@ -212,8 +212,8 @@ TVectorShape = class procedure FillFit; procedure QuickDefine(constref APoint1,APoint2: TPointF); virtual; abstract; //one of the two Render functions must be overriden - procedure Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; ADraft: boolean); virtual; - procedure Render(ADest: TBGRABitmap; ARenderOffset: TPoint; AMatrix: TAffineMatrix; ADraft: boolean); virtual; + procedure Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; ADraft: boolean); overload; virtual; + procedure Render(ADest: TBGRABitmap; ARenderOffset: TPoint; AMatrix: TAffineMatrix; ADraft: boolean); overload; virtual; function GetRenderBounds(ADestRect: TRect; AMatrix: TAffineMatrix; AOptions: TRenderBoundsOptions = []): TRectF; virtual; abstract; function SuggestGradientBox(AMatrix: TAffineMatrix): TAffineBox; virtual; function PointInShape(APoint: TPointF): boolean; overload; virtual; abstract; @@ -245,6 +245,9 @@ TVectorShape = class function GetGenericCost: integer; virtual; function GetUsedTextures: ArrayOfBGRABitmap; virtual; procedure Transform(const AMatrix: TAffineMatrix); virtual; + procedure TransformFrame(const AMatrix: TAffineMatrix); virtual; abstract; + procedure TransformFill(const AMatrix: TAffineMatrix; ABackOnly: boolean); virtual; + function AllowShearTransform: boolean; virtual; class function Fields: TVectorShapeFields; virtual; class function Usermodes: TVectorShapeUsermodes; virtual; class function PreferPixelCentered: boolean; virtual; @@ -1281,8 +1284,8 @@ procedure TVectorShape.Transform(const AMatrix: TAffineMatrix); begin if IsAffineMatrixIdentity(AMatrix) then exit; BeginUpdate; - if vsfBackFill in Fields then BackFill.Transform(AMatrix); - if vsfPenFill in Fields then PenFill.Transform(AMatrix); + TransformFrame(AMatrix); + TransformFill(AMatrix, False); zoom := (VectLen(AMatrix[1,1],AMatrix[2,1])+VectLen(AMatrix[1,2],AMatrix[2,2]))/2; if vsfPenWidth in Fields then PenWidth := zoom*PenWidth; if vsfOutlineFill in Fields then OutlineWidth := zoom*OutlineWidth; @@ -1566,6 +1569,23 @@ function TVectorShape.GetIsFollowingMouse: boolean; result := false; end; +procedure TVectorShape.TransformFill(const AMatrix: TAffineMatrix; ABackOnly: boolean); +begin + BeginUpdate; + if vsfBackFill in Fields then BackFill.Transform(AMatrix); + if not ABackOnly then + begin + if vsfPenFill in Fields then PenFill.Transform(AMatrix); + if vsfOutlineFill in Fields then OutlineFill.Transform(AMatrix); + end; + EndUpdate; +end; + +function TVectorShape.AllowShearTransform: boolean; +begin + result := true; +end; + function TVectorShape.GetIsFront: boolean; begin result := Assigned(Container) and (Container.IndexOfShape(self)=Container.ShapeCount-1); diff --git a/lazpaintcontrols/lcvectorpolyshapes.pas b/lazpaintcontrols/lcvectorpolyshapes.pas index fe8d64f9..e929d5ae 100644 --- a/lazpaintcontrols/lcvectorpolyshapes.pas +++ b/lazpaintcontrols/lcvectorpolyshapes.pas @@ -118,7 +118,7 @@ TCustomPolypointShape = class(TVectorShape) procedure LoadFromStorage(AStorage: TBGRACustomOriginalStorage); override; procedure SaveToStorage(AStorage: TBGRACustomOriginalStorage); override; procedure ConfigureCustomEditor(AEditor: TBGRAOriginalEditor); override; - procedure Transform(const AMatrix: TAffineMatrix); override; + procedure TransformFrame(const AMatrix: TAffineMatrix); override; class function Usermodes: TVectorShapeUsermodes; override; class function DefaultArrowSize: TPointF; property Points[AIndex:integer]: TPointF read GetPoint write SetPoint; @@ -141,7 +141,7 @@ TPolylineShape = class(TCustomPolypointShape) function BackVisible: boolean; public class function Fields: TVectorShapeFields; override; - procedure Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; ADraft: boolean); override; + procedure Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; ADraft: boolean); overload; override; function GetRenderBounds({%H-}ADestRect: TRect; AMatrix: TAffineMatrix; AOptions: TRenderBoundsOptions = []): TRectF; override; function PointInShape(APoint: TPointF): boolean; overload; override; function PointInShape(APoint: TPointF; ARadius: single): boolean; overload; override; @@ -1147,7 +1147,7 @@ procedure TCustomPolypointShape.ConfigureCustomEditor(AEditor: TBGRAOriginalEdit FCenterPointEditorIndex := -1; end; -procedure TCustomPolypointShape.Transform(const AMatrix: TAffineMatrix); +procedure TCustomPolypointShape.TransformFrame(const AMatrix: TAffineMatrix); var i: Integer; m: TAffineMatrix; @@ -1156,7 +1156,6 @@ procedure TCustomPolypointShape.Transform(const AMatrix: TAffineMatrix); m := MatrixForPixelCentered(AMatrix); for i := 0 to PointCount-1 do FPoints[i].coord := m*FPoints[i].coord; - inherited Transform(AMatrix); EndUpdate; end; diff --git a/lazpaintcontrols/lcvectorrectshapes.pas b/lazpaintcontrols/lcvectorrectshapes.pas index e63a7065..15832ee0 100644 --- a/lazpaintcontrols/lcvectorrectshapes.pas +++ b/lazpaintcontrols/lcvectorrectshapes.pas @@ -62,10 +62,9 @@ TCustomRectShape = class(TVectorShape) procedure OnMoveXYNegCornerAlt({%H-}ASender: TObject; {%H-}APrevCoord, ANewCoord: TPointF; AShift: TShiftState); procedure OnMoveXNegYNegCornerAlt({%H-}ASender: TObject; {%H-}APrevCoord, ANewCoord: TPointF; AShift: TShiftState); procedure OnStartMove({%H-}ASender: TObject; {%H-}APointIndex: integer; {%H-}AShift: TShiftState); - procedure UpdateFillMatrixFromRect; + procedure UpdateFillFromRectDiff; function GetCornerPositition: single; virtual; abstract; function GetOrthoRect(AMatrix: TAffineMatrix; out ARect: TRectF): boolean; - function AllowShearTransform: boolean; virtual; function ShowArrows: boolean; virtual; procedure SetOrigin(AValue: TPointF); function GetHeight: single; @@ -82,7 +81,7 @@ TCustomRectShape = class(TVectorShape) function GetRenderBounds({%H-}ADestRect: TRect; AMatrix: TAffineMatrix; {%H-}AOptions: TRenderBoundsOptions = []): TRectF; override; procedure ConfigureCustomEditor(AEditor: TBGRAOriginalEditor); override; function GetAffineBox(const AMatrix: TAffineMatrix; APixelCentered: boolean): TAffineBox; - procedure Transform(const AMatrix: TAffineMatrix); override; + procedure TransformFrame(const AMatrix: TAffineMatrix); override; procedure AlignTransform(const AMatrix: TAffineMatrix); override; property Origin: TPointF read FOrigin write SetOrigin; property XAxis: TPointF read FXAxis write SetXAxis; @@ -101,7 +100,7 @@ TRectShape = class(TCustomRectShape) function GetCornerPositition: single; override; public class function Fields: TVectorShapeFields; override; - procedure Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; ADraft: boolean); override; + procedure Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; ADraft: boolean); overload; override; function GetRenderBounds({%H-}ADestRect: TRect; AMatrix: TAffineMatrix; AOptions: TRenderBoundsOptions = []): TRectF; override; function PointInShape(APoint: TPointF): boolean; overload; override; function PointInShape(APoint: TPointF; ARadius: single): boolean; overload; override; @@ -122,7 +121,7 @@ TEllipseShape = class(TCustomRectShape) constructor Create(AContainer: TVectorOriginal); override; class function Fields: TVectorShapeFields; override; function GetAlignBounds(const {%H-}ALayoutRect: TRect; const AMatrix: TAffineMatrix): TRectF; override; - procedure Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; ADraft: boolean); override; + procedure Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; ADraft: boolean); overload; override; function GetRenderBounds({%H-}ADestRect: TRect; AMatrix: TAffineMatrix; AOptions: TRenderBoundsOptions = []): TRectF; override; function PointInShape(APoint: TPointF): boolean; overload; override; function PointInShape(APoint: TPointF; ARadius: single): boolean; overload; override; @@ -177,8 +176,6 @@ TPhongShape = class(TCustomRectShape) procedure SetShapeKind(AValue: TPhongShapeKind); function BackVisible: boolean; function GetEnvelope: ArrayOfTPointF; - protected - function AllowShearTransform: boolean; override; public constructor Create(AContainer: TVectorOriginal); override; destructor Destroy; override; @@ -190,7 +187,7 @@ TPhongShape = class(TCustomRectShape) procedure MouseDown(RightButton: boolean; Shift: TShiftState; X, Y: single; var ACursor: TOriginalEditorCursor; var AHandled: boolean); override; procedure LoadFromStorage(AStorage: TBGRACustomOriginalStorage); override; procedure SaveToStorage(AStorage: TBGRACustomOriginalStorage); override; - procedure Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; ADraft: boolean); override; + procedure Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; ADraft: boolean); overload; override; function GetRenderBounds({%H-}ADestRect: TRect; AMatrix: TAffineMatrix; AOptions: TRenderBoundsOptions = []): TRectF; override; function PointInShape(APoint: TPointF): boolean; overload; override; function PointInShape(APoint: TPointF; ARadius: single): boolean; overload; override; @@ -198,6 +195,7 @@ TPhongShape = class(TCustomRectShape) function GetIsSlow(const AMatrix: TAffineMatrix): boolean; override; function GetGenericCost: integer; override; procedure Transform(const AMatrix: TAffineMatrix); override; + function AllowShearTransform: boolean; override; class function StorageClassName: RawByteString; override; property ShapeKind: TPhongShapeKind read FShapeKind write SetShapeKind; property LightPosition: TPointF read FLightPosition write SetLightPosition; @@ -359,8 +357,7 @@ procedure TCustomRectShape.SetOrigin(AValue: TPointF); FOrigin := AValue; FXAxis := t*FXAxis; FYAxis := t*FYAxis; - if vsfBackFill in Fields then BackFill.Transform(t); - if vsfPenFill in Fields then PenFill.Transform(t); + TransformFill(t, False); EndUpdate; end; @@ -504,7 +501,7 @@ procedure TCustomRectShape.DoMoveXAxis(ANewCoord: TPointF; AShift: TShiftState; end; end; EnsureRatio(-AFactor,0); - UpdateFillMatrixFromRect; + UpdateFillFromRectDiff; EndUpdate; end; @@ -543,7 +540,7 @@ procedure TCustomRectShape.DoMoveYAxis(ANewCoord: TPointF; AShift: TShiftState; end; end; EnsureRatio(0,-AFactor); - UpdateFillMatrixFromRect; + UpdateFillFromRectDiff; EndUpdate; end; @@ -603,7 +600,7 @@ procedure TCustomRectShape.DoMoveXYCorner(ANewCoord: TPointF; end; end; EnsureRatio(-AFactorX,-AFactorY); - UpdateFillMatrixFromRect; + UpdateFillFromRectDiff; EndUpdate; end; @@ -724,18 +721,15 @@ procedure TCustomRectShape.OnStartMove(ASender: TObject; APointIndex: integer; FMatrixBackup := AffineMatrix(FXAxis-FOrigin, FYAxis-FOrigin, FOrigin); end; -procedure TCustomRectShape.UpdateFillMatrixFromRect; +procedure TCustomRectShape.UpdateFillFromRectDiff; var newMatrix, matrixDiff: TAffineMatrix; begin newMatrix := AffineMatrix(FXAxis-FOrigin, FYAxis-FOrigin, FOrigin); if IsAffineMatrixInversible(newMatrix) and IsAffineMatrixInversible(FMatrixBackup) then begin - if vsfBackFill in Fields then - begin - matrixDiff := newMatrix*AffineMatrixInverse(FMatrixBackup); - BackFill.Transform(matrixDiff); - end; + matrixDiff := newMatrix*AffineMatrixInverse(FMatrixBackup); + TransformFill(matrixDiff, True); FMatrixBackup := newMatrix; end; end; @@ -752,7 +746,7 @@ function TCustomRectShape.GetAffineBox(const AMatrix: TAffineMatrix; APixelCente FXAxis - (FYAxis - FOrigin), FYAxis - (FXAxis - FOrigin)); end; -procedure TCustomRectShape.Transform(const AMatrix: TAffineMatrix); +procedure TCustomRectShape.TransformFrame(const AMatrix: TAffineMatrix); var m: TAffineMatrix; begin @@ -761,7 +755,6 @@ procedure TCustomRectShape.Transform(const AMatrix: TAffineMatrix); FOrigin := m*FOrigin; FXAxis := m*FXAxis; FYAxis := m*FYAxis; - inherited Transform(AMatrix); EndUpdate; end; @@ -793,11 +786,6 @@ function TCustomRectShape.GetOrthoRect(AMatrix: TAffineMatrix; out ARect: TRectF end; end; -function TCustomRectShape.AllowShearTransform: boolean; -begin - result := true; -end; - function TCustomRectShape.ShowArrows: boolean; begin result := true; diff --git a/lazpaintcontrols/lcvectortextshapes.pas b/lazpaintcontrols/lcvectortextshapes.pas index cf829fa6..7a3b38ba 100644 --- a/lazpaintcontrols/lcvectortextshapes.pas +++ b/lazpaintcontrols/lcvectortextshapes.pas @@ -121,7 +121,6 @@ TTextShape = class(TCustomRectShape) procedure DoOnChange(ABoundsBefore: TRectF; ADiff: TVectorShapeDiff); override; procedure SetGlobalMatrix(AMatrix: TAffineMatrix); function PenVisible(AAssumePenFill: boolean = false): boolean; - function AllowShearTransform: boolean; override; function ShowArrows: boolean; override; function GetTextLayout: TBidiTextLayout; function GetFontRenderer: TBGRACustomFontRenderer; @@ -153,7 +152,7 @@ TTextShape = class(TCustomRectShape) class function StorageClassName: RawByteString; override; class function Usermodes: TVectorShapeUsermodes; override; procedure ConfigureCustomEditor(AEditor: TBGRAOriginalEditor); override; - procedure Render(ADest: TBGRABitmap; ARenderOffset: TPoint; AMatrix: TAffineMatrix; ADraft: boolean); override; + procedure Render(ADest: TBGRABitmap; ARenderOffset: TPoint; AMatrix: TAffineMatrix; ADraft: boolean); overload; override; function GetRenderBounds({%H-}ADestRect: TRect; AMatrix: TAffineMatrix; AOptions: TRenderBoundsOptions = []): TRectF; override; function PointInShape(APoint: TPointF): boolean; overload; override; function PointInShape({%H-}APoint: TPointF; {%H-}ARadius: single): boolean; overload; override; @@ -173,6 +172,7 @@ TTextShape = class(TCustomRectShape) function DeleteSelection: boolean; function GetAlignBounds(const {%H-}ALayoutRect: TRect; const AMatrix: TAffineMatrix): TRectF; override; procedure Transform(const AMatrix: TAffineMatrix); override; + function AllowShearTransform: boolean; override; property HasSelection: boolean read GetHasSelection; property CanPasteSelection: boolean read GetCanPasteSelection; property Text: string read FText write SetText; From 0f018aa878b71fec4a9aba3d4b07fbd220e5fc48 Mon Sep 17 00:00:00 2001 From: johann Date: Sat, 14 Mar 2020 13:13:26 +0100 Subject: [PATCH 26/53] scripts sub menus --- lazpaint/umenu.pas | 53 +++++++++++++++---- .../{merge_channels.py => channels_merge.py} | 2 +- ...it_hsl_native.py => channels_split_hsl.py} | 2 +- ...it_rgb_native.py => channels_split_rgb.py} | 2 +- ...or_overlay.py => layerfx_color_overlay.py} | 2 +- .../{layer_shadow.py => layerfx_shadow.py} | 2 +- .../{layer_stroke.py => layerfx_stroke.py} | 2 +- scripts/mask_from_alpha.py | 12 +++++ scripts/{new_mask.py => mask_new.py} | 2 +- ...fractal_tree.py => render_fractal_tree.py} | 2 +- scripts/render_lava.py | 2 +- 11 files changed, 65 insertions(+), 18 deletions(-) rename scripts/{merge_channels.py => channels_merge.py} (98%) rename scripts/{split_hsl_native.py => channels_split_hsl.py} (98%) rename scripts/{split_rgb_native.py => channels_split_rgb.py} (98%) rename scripts/{color_overlay.py => layerfx_color_overlay.py} (91%) rename scripts/{layer_shadow.py => layerfx_shadow.py} (99%) rename scripts/{layer_stroke.py => layerfx_stroke.py} (99%) create mode 100644 scripts/mask_from_alpha.py rename scripts/{new_mask.py => mask_new.py} (96%) rename scripts/{fractal_tree.py => render_fractal_tree.py} (98%) diff --git a/lazpaint/umenu.pas b/lazpaint/umenu.pas index 89638e91..f3202531 100644 --- a/lazpaint/umenu.pas +++ b/lazpaint/umenu.pas @@ -240,6 +240,47 @@ procedure TMainFormMenu.AddMenus(AMenuName: string; AActionsCommaText: string); end; procedure TMainFormMenu.AddInstalledScripts(AMenu: TMenuItem; AIndex: integer); + + procedure AddScriptRec(AMenu: TMenuItem; var AIndex: integer; AItem: TMenuItem); + var + posSub, j, subIndex: integer; + sectionName: String; + sectionItem: TMenuItem; + begin + posSub := pos('>', AItem.Caption); + if posSub > 0 then + begin + sectionName := copy(AItem.Caption, 1, posSub-1); + AItem.Caption := copy(AItem.Caption, posSub+1, length(AItem.Caption) - posSub); + subIndex := -1; + for j := 0 to AMenu.Count-1 do + if AMenu.Items[j].Caption = sectionName then + begin + AddScriptRec(AMenu.Items[j], subIndex, AItem); + exit; + end; + sectionItem := TMenuItem.Create(AMenu); + sectionItem.Caption := sectionName; + if AIndex = -1 then + AMenu.Add(sectionItem) + else + begin + AMenu.Insert(AIndex, sectionItem); + inc(AIndex); + end; + AddScriptRec(sectionItem, subIndex, AItem); + exit; + end; + + if AIndex = -1 then + AMenu.Add(AItem) + else + begin + AMenu.Insert(AIndex, AItem); + inc(AIndex); + end; + end; + var path, fullname, header, title: String; searchRec: TSearchRec; @@ -266,6 +307,8 @@ procedure TMainFormMenu.AddInstalledScripts(AMenu: TMenuItem; AIndex: integer); if header.StartsWith('#') then begin title := header.Substring(1).Trim; + title := StringReplace(title, ' >', '>', [rfReplaceAll]); + title := StringReplace(title, '> ', '>', [rfReplaceAll]); item := TMenuItem.Create(AMenu); item.Caption := title; item.Tag := FInstalledScripts.Add(fullname); @@ -277,15 +320,7 @@ procedure TMainFormMenu.AddInstalledScripts(AMenu: TMenuItem; AIndex: integer); finally FindCloseUTF8(searchRec); for i := 0 to items.Count-1 do - begin - if AIndex = -1 then - AMenu.Add(TMenuItem(items.Objects[i])) - else - begin - AMenu.Insert(AIndex, TMenuItem(items.Objects[i])); - inc(AIndex); - end; - end; + AddScriptRec(AMenu, AIndex, TMenuItem(items.Objects[i])); items.Free; end; end; diff --git a/scripts/merge_channels.py b/scripts/channels_merge.py similarity index 98% rename from scripts/merge_channels.py rename to scripts/channels_merge.py index 2323511d..94cd3de0 100644 --- a/scripts/merge_channels.py +++ b/scripts/channels_merge.py @@ -1,4 +1,4 @@ -# Merge channels +# Channels > Merge from lazpaint import image, dialog, layer channels_id = None diff --git a/scripts/split_hsl_native.py b/scripts/channels_split_hsl.py similarity index 98% rename from scripts/split_hsl_native.py rename to scripts/channels_split_hsl.py index d6d90411..f1ebb3e0 100644 --- a/scripts/split_hsl_native.py +++ b/scripts/channels_split_hsl.py @@ -1,4 +1,4 @@ -# Split HSL channels +# Channels > Split HSL from lazpaint import image, dialog, layer, filters # check if it is a channel diff --git a/scripts/split_rgb_native.py b/scripts/channels_split_rgb.py similarity index 98% rename from scripts/split_rgb_native.py rename to scripts/channels_split_rgb.py index f9e4c436..b343d6fc 100644 --- a/scripts/split_rgb_native.py +++ b/scripts/channels_split_rgb.py @@ -1,4 +1,4 @@ -# Split RGB channels +# Channels > Split RGB from lazpaint import image, dialog, layer, filters # check if it is a channel diff --git a/scripts/color_overlay.py b/scripts/layerfx_color_overlay.py similarity index 91% rename from scripts/color_overlay.py rename to scripts/layerfx_color_overlay.py index c813eaf9..fb6e9a1e 100644 --- a/scripts/color_overlay.py +++ b/scripts/layerfx_color_overlay.py @@ -1,4 +1,4 @@ -# Color overlay +# Layer effect > Color overlay from lazpaint import image, colors, layer, filters color = colors.show_dialog(layer.get_registry("overlay-color")) diff --git a/scripts/layer_shadow.py b/scripts/layerfx_shadow.py similarity index 99% rename from scripts/layer_shadow.py rename to scripts/layerfx_shadow.py index 8c97143f..ed41163b 100644 --- a/scripts/layer_shadow.py +++ b/scripts/layerfx_shadow.py @@ -1,4 +1,4 @@ -# Layer shadow +# Layer effect > Drop shadow from lazpaint import dialog try: diff --git a/scripts/layer_stroke.py b/scripts/layerfx_stroke.py similarity index 99% rename from scripts/layer_stroke.py rename to scripts/layerfx_stroke.py index 2daa745c..e3689390 100644 --- a/scripts/layer_stroke.py +++ b/scripts/layerfx_stroke.py @@ -1,4 +1,4 @@ -# Layer stroke +# Layer effect > Stroke from lazpaint import dialog try: diff --git a/scripts/mask_from_alpha.py b/scripts/mask_from_alpha.py new file mode 100644 index 00000000..0ba5d4c7 --- /dev/null +++ b/scripts/mask_from_alpha.py @@ -0,0 +1,12 @@ +# Mask > Mask from alpha channel +from lazpaint import image, layer, filters, selection + +image.do_begin() + +selection.deselect() +layer.duplicate() +layer.set_name("Mask") +filters.filter_function(red="alpha", green="alpha", blue="alpha", alpha=255, gamma_correction=False) +layer.set_blend_op(layer.BLEND_MASK) + +image.do_end() diff --git a/scripts/new_mask.py b/scripts/mask_new.py similarity index 96% rename from scripts/new_mask.py rename to scripts/mask_new.py index fe3b28f4..608c06ae 100644 --- a/scripts/new_mask.py +++ b/scripts/mask_new.py @@ -1,4 +1,4 @@ -# New mask +# Mask > New mask from lazpaint import image, layer, tools, colors, selection image.do_begin() diff --git a/scripts/fractal_tree.py b/scripts/render_fractal_tree.py similarity index 98% rename from scripts/fractal_tree.py rename to scripts/render_fractal_tree.py index 1fa16a51..8e1b8b76 100644 --- a/scripts/fractal_tree.py +++ b/scripts/render_fractal_tree.py @@ -1,4 +1,4 @@ -# Render fractal tree +# Render > Fractal tree from lazpaint import tools, image, layer, dialog import math, random diff --git a/scripts/render_lava.py b/scripts/render_lava.py index c6e68767..e4164fc9 100644 --- a/scripts/render_lava.py +++ b/scripts/render_lava.py @@ -1,4 +1,4 @@ -# Render Lava +# Render > Lava from lazpaint import image, layer, filters, colors image.do_begin() From 8686bee28338762bb576289eb0cb69128903b844 Mon Sep 17 00:00:00 2001 From: johann Date: Sat, 14 Mar 2020 20:43:40 +0100 Subject: [PATCH 27/53] script: inner shadow/light can be combined with color overlay --- scripts/layerfx_innerlight.py | 261 +++++++++++++++++++++++++++++++++ scripts/layerfx_innershadow.py | 261 +++++++++++++++++++++++++++++++++ 2 files changed, 522 insertions(+) create mode 100644 scripts/layerfx_innerlight.py create mode 100644 scripts/layerfx_innershadow.py diff --git a/scripts/layerfx_innerlight.py b/scripts/layerfx_innerlight.py new file mode 100644 index 00000000..c7ddd375 --- /dev/null +++ b/scripts/layerfx_innerlight.py @@ -0,0 +1,261 @@ +# Layer effect > Inner light +from lazpaint import dialog + +try: + from tkinter import * +except ImportError: + dialog.show_message("Please install tkinter.") + exit() + +from lazpaint import colors, image, layer, filters, tools, selection +import math + +if layer.is_empty(): + dialog.show_message("Layer is empty") + exit() + +############ image processing + +FRIENDLY_NAME = "Inner light" +REGISTRY_NAME = "innerlight" +OPPOSITE_REGISTRY_NAME = "innershadow" +DEFAULT_ANGLE = 315 +DEFAULT_COLOR = colors.WHITE + +MAX_RADIUS = 200 +MAX_OPACITY = 255 +MAX_ANGLE = 360 + +source_layer_id = layer.get_registry(REGISTRY_NAME+"-source-layer-id") +if source_layer_id is not None: + layer.select_id(source_layer_id) +else: + source_layer_id = layer.get_id() +source_layer_name = layer.get_name() + +chosen_radius = layer.get_registry(REGISTRY_NAME+"-radius") +if chosen_radius == None: + chosen_radius = layer.get_registry(OPPOSITE_REGISTRY_NAME+"-radius") +if chosen_radius == None: + chosen_radius = image.get_registry(REGISTRY_NAME+"-radius") +if chosen_radius == None: + chosen_radius = image.get_registry(OPPOSITE_REGISTRY_NAME+"-radius") +if chosen_radius == None: + chosen_radius = 20 + +chosen_angle = layer.get_registry(REGISTRY_NAME+"-angle") +if chosen_angle == None: + chosen_angle = layer.get_registry(OPPOSITE_REGISTRY_NAME+"-angle") + if chosen_angle is not None: + chosen_angle = (chosen_angle+180) % 360 +if chosen_angle == None: + chosen_angle = image.get_registry(REGISTRY_NAME+"-angle") +if chosen_angle == None: + chosen_angle = image.get_registry(OPPOSITE_REGISTRY_NAME+"-angle") + if chosen_angle is not None: + chosen_angle = (chosen_angle+180) % 360 +if chosen_angle == None: + chosen_angle = DEFAULT_ANGLE + +shadow_layer_id = layer.get_registry(REGISTRY_NAME+"-layer-id") +if image.get_layer_index(shadow_layer_id) == None: + shadow_layer_id = None + +if shadow_layer_id is not None: + layer.select_id(shadow_layer_id) + chosen_opacity = layer.get_opacity() + overlay_color = colors.str_to_RGBA(layer.get_registry("overlay-color")) + layer.select_id(source_layer_id) +else: + chosen_opacity = layer.get_opacity()*2/3 + overlay_color = None + +if overlay_color is None: + overlay_color = DEFAULT_COLOR + +def create_shadow_layer(): + global shadow_layer_id + image.do_begin() + if shadow_layer_id != None: + layer.select_id(shadow_layer_id) + layer.remove() + layer.select_id(source_layer_id) + layer.duplicate() + layer.rasterize() + layer.set_name(FRIENDLY_NAME+" of "+source_layer_name) + layer.set_registry(REGISTRY_NAME+"-source-layer-id", source_layer_id) + shadow_layer_id = layer.get_id() + layer.set_registry("overlay-color", overlay_color) + layer.set_opacity(chosen_opacity) + image.do_end() + +blur_done = False +opacity_done = False + +def apply_blur(): + global blur_done, opacity_done + if opacity_done: + image.undo() + opacity_done = False + if blur_done: + image.undo() + blur_done = False + image.do_begin() + if chosen_radius == 0: + filters.filter_function(alpha=0, gamma_correction=False) + else: + layer.duplicate() + layer.set_opacity(255) + filters.filter_function(red="alpha", green="alpha", blue="alpha", alpha=1, gamma_correction=False) + mask_layer_id = layer.get_id() + + layer.select_id(shadow_layer_id) + filters.filter_function(red=overlay_color.red/255, green=overlay_color.green/255, blue=overlay_color.blue/255, gamma_correction=False) + tools.choose(tools.MOVE_LAYER) + offset = (math.sin(chosen_angle*math.pi/180)*chosen_radius, -math.cos(chosen_angle*math.pi/180)*chosen_radius) + tools.mouse([(0,0), (offset[0],offset[1])]) + + layer.select_id(mask_layer_id) + layer.duplicate() + mask_layer_id2 = layer.get_id() + layer.select_id(mask_layer_id) + tools.choose(tools.MOVE_LAYER) + tools.mouse([(offset[0]/2,offset[1]/2), (0,0)]) + colors.linear_negative() + layer.set_blend_op(layer.BLEND_MASK) + layer.merge_over() + mask_layer_id = mask_layer_id2 + + filters.blur(radius=chosen_radius) + + layer.select_id(mask_layer_id) + layer.set_blend_op(layer.BLEND_MASK) + layer.merge_over() + + blur_done = image.do_end() + apply_opacity() + +def apply_opacity(): + global opacity_done + if opacity_done: + image.undo() + opacity_done = False + image.do_begin() + layer.set_opacity(chosen_opacity) + opacity_done = image.do_end() + +######## interface + +def button_ok_click(): + global source_layer_id, chosen_radius, chosen_angle + layer.select_id(source_layer_id) + layer.set_registry(REGISTRY_NAME+"-radius", chosen_radius) + layer.set_registry(REGISTRY_NAME+"-angle", chosen_angle) + layer.set_registry(REGISTRY_NAME+"-layer-id", shadow_layer_id) + image.set_registry(REGISTRY_NAME+"-radius", chosen_radius) + image.set_registry(REGISTRY_NAME+"-angle", chosen_angle) + image.do_end() + exit() + +def button_cancel_click(): + if image.do_end(): + image.undo() + layer.select_id(source_layer_id) + exit() + +scale_radius_update_job = None + +def scale_radius_update_do(): + global scale_radius_update_job, chosen_radius, scale_radius + new_radius = scale_radius.get() + if new_radius != chosen_radius: + chosen_radius = new_radius + apply_blur() + scale_radius_update_job = None + +def scale_radius_update(event): + global window, scale_radius_update_job + if scale_radius_update_job: + window.after_cancel(scale_radius_update_job) + scale_radius_update_job = window.after(800, scale_radius_update_do) + +scale_angle_update_job = None + +def scale_angle_update_do(): + global scale_angle_update_job, chosen_angle, scale_angle + new_angle = scale_angle.get() + if new_angle != chosen_angle: + chosen_angle = new_angle + apply_blur() + scale_angle_update_job = None + +def scale_angle_update(event): + global window, scale_angle_update_job + if scale_angle_update_job: + window.after_cancel(scale_angle_update_job) + scale_angle_update_job = window.after(800, scale_angle_update_do) + +scale_opacity_update_job = None + +def scale_opacity_update_do(): + global chosen_opacity + new_opacity = scale_opacity.get() + if new_opacity != chosen_opacity: + chosen_opacity = new_opacity + apply_opacity() + scale_opacity_update_job = None + +def scale_opacity_update(event): + global window, scale_opacity_update_job + if scale_opacity_update_job: + window.after_cancel(scale_opacity_update_job) + scale_opacity_update_job = window.after(100, scale_opacity_update_do) + +window = Tk() +window.title(FRIENDLY_NAME) +window.resizable(False, False) + +frame = Frame(window) +frame.pack() + +label_radius = Label(frame, text="Radius:") +label_radius.grid(column=0, row=0) +scale_radius = Scale(frame, from_=0, to=MAX_RADIUS, orient=HORIZONTAL, command=scale_radius_update) +scale_radius.grid(column=1, row=0, sticky=W+E, padx=10) +scale_radius.set(chosen_radius) + +label_angle = Label(frame, text="Angle:") +label_angle.grid(column=0, row=1) +scale_angle = Scale(frame, from_=0, to=MAX_ANGLE, orient=HORIZONTAL, command=scale_angle_update) +scale_angle.grid(column=1, row=1, sticky=W+E, padx=10) +scale_angle.set(chosen_angle) + +label_opacity = Label(frame, text="Opacity:") +label_opacity.grid(column=0, row=2) +scale_opacity = Scale(frame, from_=0, to=MAX_OPACITY, orient=HORIZONTAL, command=scale_opacity_update) +scale_opacity.grid(column=1, row=2, sticky=W+E, padx=10) +scale_opacity.set(chosen_opacity) + +frame.columnconfigure(0, pad=20) +frame.columnconfigure(1, minsize=250) +frame.rowconfigure(0, pad=20) +frame.rowconfigure(1, pad=20) +frame.rowconfigure(2, pad=20) + +button_ok = Button(window, text="Ok", command=button_ok_click) +button_ok.pack(side=RIGHT, padx=10, pady=10) +button_cancel = Button(window, text="Cancel", command=button_cancel_click) +button_cancel.pack(side=RIGHT, pady=10) + +image.do_begin() +selection.deselect() +create_shadow_layer() +apply_blur() + +window.update() +window_width = window.winfo_width() +screen_width = window.winfo_screenwidth() +window.geometry('+%d+0' % (int((screen_width - window_width) / 2))) + +window.mainloop() +button_cancel_click() diff --git a/scripts/layerfx_innershadow.py b/scripts/layerfx_innershadow.py new file mode 100644 index 00000000..6f695987 --- /dev/null +++ b/scripts/layerfx_innershadow.py @@ -0,0 +1,261 @@ +# Layer effect > Inner shadow +from lazpaint import dialog + +try: + from tkinter import * +except ImportError: + dialog.show_message("Please install tkinter.") + exit() + +from lazpaint import colors, image, layer, filters, tools, selection +import math + +if layer.is_empty(): + dialog.show_message("Layer is empty") + exit() + +############ image processing + +FRIENDLY_NAME = "Inner shadow" +REGISTRY_NAME = "innershadow" +OPPOSITE_REGISTRY_NAME = "innerlight" +DEFAULT_ANGLE = 135 +DEFAULT_COLOR = colors.BLACK + +MAX_RADIUS = 200 +MAX_OPACITY = 255 +MAX_ANGLE = 360 + +source_layer_id = layer.get_registry(REGISTRY_NAME+"-source-layer-id") +if source_layer_id is not None: + layer.select_id(source_layer_id) +else: + source_layer_id = layer.get_id() +source_layer_name = layer.get_name() + +chosen_radius = layer.get_registry(REGISTRY_NAME+"-radius") +if chosen_radius == None: + chosen_radius = layer.get_registry(OPPOSITE_REGISTRY_NAME+"-radius") +if chosen_radius == None: + chosen_radius = image.get_registry(REGISTRY_NAME+"-radius") +if chosen_radius == None: + chosen_radius = image.get_registry(OPPOSITE_REGISTRY_NAME+"-radius") +if chosen_radius == None: + chosen_radius = 20 + +chosen_angle = layer.get_registry(REGISTRY_NAME+"-angle") +if chosen_angle == None: + chosen_angle = layer.get_registry(OPPOSITE_REGISTRY_NAME+"-angle") + if chosen_angle is not None: + chosen_angle = (chosen_angle+180) % 360 +if chosen_angle == None: + chosen_angle = image.get_registry(REGISTRY_NAME+"-angle") +if chosen_angle == None: + chosen_angle = image.get_registry(OPPOSITE_REGISTRY_NAME+"-angle") + if chosen_angle is not None: + chosen_angle = (chosen_angle+180) % 360 +if chosen_angle == None: + chosen_angle = DEFAULT_ANGLE + +shadow_layer_id = layer.get_registry(REGISTRY_NAME+"-layer-id") +if image.get_layer_index(shadow_layer_id) == None: + shadow_layer_id = None + +if shadow_layer_id is not None: + layer.select_id(shadow_layer_id) + chosen_opacity = layer.get_opacity() + overlay_color = colors.str_to_RGBA(layer.get_registry("overlay-color")) + layer.select_id(source_layer_id) +else: + chosen_opacity = layer.get_opacity()*2/3 + overlay_color = None + +if overlay_color is None: + overlay_color = DEFAULT_COLOR + +def create_shadow_layer(): + global shadow_layer_id + image.do_begin() + if shadow_layer_id != None: + layer.select_id(shadow_layer_id) + layer.remove() + layer.select_id(source_layer_id) + layer.duplicate() + layer.rasterize() + layer.set_name(FRIENDLY_NAME+" of "+source_layer_name) + layer.set_registry(REGISTRY_NAME+"-source-layer-id", source_layer_id) + shadow_layer_id = layer.get_id() + layer.set_registry("overlay-color", overlay_color) + layer.set_opacity(chosen_opacity) + image.do_end() + +blur_done = False +opacity_done = False + +def apply_blur(): + global blur_done, opacity_done + if opacity_done: + image.undo() + opacity_done = False + if blur_done: + image.undo() + blur_done = False + image.do_begin() + if chosen_radius == 0: + filters.filter_function(alpha=0, gamma_correction=False) + else: + layer.duplicate() + layer.set_opacity(255) + filters.filter_function(red="alpha", green="alpha", blue="alpha", alpha=1, gamma_correction=False) + mask_layer_id = layer.get_id() + + layer.select_id(shadow_layer_id) + filters.filter_function(red=overlay_color.red/255, green=overlay_color.green/255, blue=overlay_color.blue/255, gamma_correction=False) + tools.choose(tools.MOVE_LAYER) + offset = (math.sin(chosen_angle*math.pi/180)*chosen_radius, -math.cos(chosen_angle*math.pi/180)*chosen_radius) + tools.mouse([(0,0), (offset[0],offset[1])]) + + layer.select_id(mask_layer_id) + layer.duplicate() + mask_layer_id2 = layer.get_id() + layer.select_id(mask_layer_id) + tools.choose(tools.MOVE_LAYER) + tools.mouse([(offset[0]/2,offset[1]/2), (0,0)]) + colors.linear_negative() + layer.set_blend_op(layer.BLEND_MASK) + layer.merge_over() + mask_layer_id = mask_layer_id2 + + filters.blur(radius=chosen_radius) + + layer.select_id(mask_layer_id) + layer.set_blend_op(layer.BLEND_MASK) + layer.merge_over() + + blur_done = image.do_end() + apply_opacity() + +def apply_opacity(): + global opacity_done + if opacity_done: + image.undo() + opacity_done = False + image.do_begin() + layer.set_opacity(chosen_opacity) + opacity_done = image.do_end() + +######## interface + +def button_ok_click(): + global source_layer_id, chosen_radius, chosen_angle + layer.select_id(source_layer_id) + layer.set_registry(REGISTRY_NAME+"-radius", chosen_radius) + layer.set_registry(REGISTRY_NAME+"-angle", chosen_angle) + layer.set_registry(REGISTRY_NAME+"-layer-id", shadow_layer_id) + image.set_registry(REGISTRY_NAME+"-radius", chosen_radius) + image.set_registry(REGISTRY_NAME+"-angle", chosen_angle) + image.do_end() + exit() + +def button_cancel_click(): + if image.do_end(): + image.undo() + layer.select_id(source_layer_id) + exit() + +scale_radius_update_job = None + +def scale_radius_update_do(): + global scale_radius_update_job, chosen_radius, scale_radius + new_radius = scale_radius.get() + if new_radius != chosen_radius: + chosen_radius = new_radius + apply_blur() + scale_radius_update_job = None + +def scale_radius_update(event): + global window, scale_radius_update_job + if scale_radius_update_job: + window.after_cancel(scale_radius_update_job) + scale_radius_update_job = window.after(800, scale_radius_update_do) + +scale_angle_update_job = None + +def scale_angle_update_do(): + global scale_angle_update_job, chosen_angle, scale_angle + new_angle = scale_angle.get() + if new_angle != chosen_angle: + chosen_angle = new_angle + apply_blur() + scale_angle_update_job = None + +def scale_angle_update(event): + global window, scale_angle_update_job + if scale_angle_update_job: + window.after_cancel(scale_angle_update_job) + scale_angle_update_job = window.after(800, scale_angle_update_do) + +scale_opacity_update_job = None + +def scale_opacity_update_do(): + global chosen_opacity + new_opacity = scale_opacity.get() + if new_opacity != chosen_opacity: + chosen_opacity = new_opacity + apply_opacity() + scale_opacity_update_job = None + +def scale_opacity_update(event): + global window, scale_opacity_update_job + if scale_opacity_update_job: + window.after_cancel(scale_opacity_update_job) + scale_opacity_update_job = window.after(100, scale_opacity_update_do) + +window = Tk() +window.title(FRIENDLY_NAME) +window.resizable(False, False) + +frame = Frame(window) +frame.pack() + +label_radius = Label(frame, text="Radius:") +label_radius.grid(column=0, row=0) +scale_radius = Scale(frame, from_=0, to=MAX_RADIUS, orient=HORIZONTAL, command=scale_radius_update) +scale_radius.grid(column=1, row=0, sticky=W+E, padx=10) +scale_radius.set(chosen_radius) + +label_angle = Label(frame, text="Angle:") +label_angle.grid(column=0, row=1) +scale_angle = Scale(frame, from_=0, to=MAX_ANGLE, orient=HORIZONTAL, command=scale_angle_update) +scale_angle.grid(column=1, row=1, sticky=W+E, padx=10) +scale_angle.set(chosen_angle) + +label_opacity = Label(frame, text="Opacity:") +label_opacity.grid(column=0, row=2) +scale_opacity = Scale(frame, from_=0, to=MAX_OPACITY, orient=HORIZONTAL, command=scale_opacity_update) +scale_opacity.grid(column=1, row=2, sticky=W+E, padx=10) +scale_opacity.set(chosen_opacity) + +frame.columnconfigure(0, pad=20) +frame.columnconfigure(1, minsize=250) +frame.rowconfigure(0, pad=20) +frame.rowconfigure(1, pad=20) +frame.rowconfigure(2, pad=20) + +button_ok = Button(window, text="Ok", command=button_ok_click) +button_ok.pack(side=RIGHT, padx=10, pady=10) +button_cancel = Button(window, text="Cancel", command=button_cancel_click) +button_cancel.pack(side=RIGHT, pady=10) + +image.do_begin() +selection.deselect() +create_shadow_layer() +apply_blur() + +window.update() +window_width = window.winfo_width() +screen_width = window.winfo_screenwidth() +window.geometry('+%d+0' % (int((screen_width - window_width) / 2))) + +window.mainloop() +button_cancel_click() From 7a0e2e5d2eb8d82f8c243c665f8b0d722af2aabe Mon Sep 17 00:00:00 2001 From: johann Date: Sat, 14 Mar 2020 20:52:20 +0100 Subject: [PATCH 28/53] complete kabyle translation --- lazpaint/release/bin/i18n/lazpaint.kab.po | 448 +++++++++-------- lazpaint/release/bin/i18n/lclstrconsts.kab.po | 451 +++++++++--------- .../release/bin/i18n/lcresourcestring.kab.po | 351 +++++++------- 3 files changed, 627 insertions(+), 623 deletions(-) diff --git a/lazpaint/release/bin/i18n/lazpaint.kab.po b/lazpaint/release/bin/i18n/lazpaint.kab.po index 1ff60925..f15fb6b1 100644 --- a/lazpaint/release/bin/i18n/lazpaint.kab.po +++ b/lazpaint/release/bin/i18n/lazpaint.kab.po @@ -9,16 +9,16 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: kab\n" -"X-Generator: Poedit 2.2.4\n" +"X-Generator: Poedit 2.3\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: tablet.getprocfailed msgid "Procedure %s failed to load properly." -msgstr "" +msgstr "Tasekkirt %s ur d-tuli ara akken iwata." #: tablet.openfailed msgid "Tablet context failed to open." -msgstr "" +msgstr "Tawennaḍt n tfelwit tegumma ad d-teldi." #: tfabout.button_donate.caption msgctxt "tfabout.button_donate.caption" @@ -42,7 +42,7 @@ msgstr "Imeskaren:" #: tfabout.label_authorsvalue.caption msgctxt "tfabout.label_authorsvalue.caption" msgid "Circular helped by FabienWang, Lainz and others" -msgstr "" +msgstr "Circular s tallelt n FabienWang, Lainz akked wiyaḍ" #: tfabout.label_homepage.caption msgctxt "tfabout.label_homepage.caption" @@ -67,7 +67,7 @@ msgstr "Open source (GPLv3)" #: tfadjustcurves.button_cancel.caption msgctxt "tfadjustcurves.button_cancel.caption" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: tfadjustcurves.button_ok.caption msgctxt "tfadjustcurves.button_ok.caption" @@ -80,12 +80,12 @@ msgstr "Sgaddi izligen" #: tfadjustcurves.toolbutton_newcurve.hint msgid "Discard current curve and start a new one" -msgstr "Sfeḍ azlig amiran u bdu azlig amaynut" +msgstr "Eǧǧ azlig amiran u bdu azlig amaynut" #: tfadjustcurves.toolbutton_posterize.hint msgctxt "tfadjustcurves.toolbutton_posterize.hint" msgid "Posterize" -msgstr "" +msgstr "Abeqqiḍ" #: tfadjustcurves.toolbutton_removepoint.hint msgid "Remove selected point (Del)" @@ -94,7 +94,7 @@ msgstr "Kkes tanqiḍt yettwafernen (Del)" #: tfblendop.button_cancel.caption msgctxt "tfblendop.button_cancel.caption" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: tfblendop.button_ok.caption msgctxt "tfblendop.button_ok.caption" @@ -140,7 +140,7 @@ msgstr "Tizḍi sufella" #: tfblendop.label_patternover.hint msgid "Preview blend operation with the specified image on top" -msgstr "" +msgstr "Tadlayt n temhelt n usmezdi s tugna i d-ittunefken sufella" #: tfblendop.label_patternunder.caption msgctxt "tfblendop.label_patternunder.caption" @@ -149,12 +149,12 @@ msgstr "Tizḍi seddaw" #: tfblendop.label_patternunder.hint msgid "Preview blend operation with the specified image underneath" -msgstr "" +msgstr "Tadlayt n temhelt n usmezdi s tugna i d-ittunefken ddaw" #: tfblendop.label_previewwith.caption msgctxt "tfblendop.label_previewwith.caption" msgid "Preview with" -msgstr "Tamuɣli akked" +msgstr "Tadlayt s" #: tfblendop.label_selectedblendop.caption msgid "Selected blend operation :" @@ -163,15 +163,15 @@ msgstr "Tamhelt n usmezdi yettwafernen:" #: tfblendop.label_svgover.caption msgctxt "tfblendop.label_svgover.caption" msgid "Basic SVG" -msgstr "SVG azadur" +msgstr "SVG azaduran" #: tfblendop.label_svgover.hint msgid "Basic blend operations that are available in virtually all image editors" -msgstr "Timehlin tizadurin n usmezdi i iwejden di tegti n imaẓragen n tugna" +msgstr "Timehlin tizaduranin n usmezdi i iwejden di tegti n yimaẓragen n tugna" #: tfbrowseimages.caption msgid "Browse images" -msgstr "Snirrem tugniwin" +msgstr "Snirem tugniwin" #: tfbrowseimages.checkbox_usedirectoryonstartup.caption msgid "Use this directory on startup" @@ -202,7 +202,7 @@ msgstr "Sken tignitin timeqranin" #: tfbrowseimages.toolbutton_viewdetails.hint msgctxt "tfbrowseimages.toolbutton_viewdetails.hint" msgid "Show details and preview" -msgstr "" +msgstr "Sken talqayt akked tedlayt" #: tfbrowseimages.tool_selectdrive.hint msgid "Select drive" @@ -211,7 +211,7 @@ msgstr "Fren ibenk" #: tfcanvassize.button_cancel.caption msgctxt "TFCANVASSIZE.BUTTON_CANCEL.CAPTION" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: tfcanvassize.button_ok.caption msgctxt "TFCANVASSIZE.BUTTON_OK.CAPTION" @@ -230,17 +230,17 @@ msgstr "Askar n tuzzya" #: tfcanvassize.label_anchor.caption msgctxt "tfcanvassize.label_anchor.caption" msgid "Anchor :" -msgstr "Tamdeyt:" +msgstr "Tamdeyt :" #: tfcanvassize.label_height.caption msgctxt "tfcanvassize.label_height.caption" msgid "Height :" -msgstr "Teɣzi:" +msgstr "Teɣzi :" #: tfcanvassize.label_width.caption msgctxt "tfcanvassize.label_width.caption" msgid "Width :" -msgstr "Tehri:" +msgstr "Tehri :" #: tfchoosecolor.bcbutton_addtopalette.hint msgid "Add color to palette" @@ -262,7 +262,7 @@ msgstr "Aglam n yini: sit iwakken ad teskecmeḍ ini s unasiw s yismawen-nnsen n #: tfcolorintensity.button_cancel.caption msgctxt "TFCOLORINTENSITY.BUTTON_CANCEL.CAPTION" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: tfcolorintensity.button_ok.caption msgctxt "TFCOLORINTENSITY.BUTTON_OK.CAPTION" @@ -272,12 +272,12 @@ msgstr "Ih" #: tfcolorintensity.caption msgctxt "tfcolorintensity.caption" msgid "Intensity" -msgstr "" +msgstr "Tadwast" #: tfcolorintensity.label_multiply.caption msgctxt "tfcolorintensity.label_multiply.caption" msgid "Multiply" -msgstr "" +msgstr "Sugget" #: tfcolorintensity.label_shift.caption msgctxt "tfcolorintensity.label_shift.caption" @@ -287,7 +287,7 @@ msgstr "Sekḥer" #: tfcolorize.button_cancel.caption msgctxt "TFCOLORIZE.BUTTON_CANCEL.CAPTION" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: tfcolorize.button_ok.caption msgctxt "TFCOLORIZE.BUTTON_OK.CAPTION" @@ -302,26 +302,26 @@ msgstr "Seɣmu" #: tfcolorize.checkbox_gsba.caption msgctxt "tfcolorize.checkbox_gsba.caption" msgid "Corrected hue and lightness" -msgstr "Tasenfelt n yini akked tifawit yettwaseɣtin" +msgstr "Tiɣmi akked tifawit yettwaseɣtan" #: tfcolorize.label_colorness.caption msgctxt "tfcolorize.label_colorness.caption" msgid "Colorness" -msgstr "" +msgstr "War ini" #: tfcolorize.label_hue.caption msgctxt "tfcolorize.label_hue.caption" msgid "Hue" -msgstr "Tasenfelt n yini" +msgstr "Tiɣmi" #: tfcolorize.label_preset.caption msgid "Preset" -msgstr "" +msgstr "Azwir-ɣewwar" #: tfcustomblur.button_cancel.caption msgctxt "TFCUSTOMBLUR.BUTTON_CANCEL.CAPTION" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: tfcustomblur.button_editmask.caption msgid "Edit mask..." @@ -348,7 +348,7 @@ msgstr "Ldi afaylu s tfesna n umelliɣdi" #: tfemboss.button_cancel.caption msgctxt "TFEMBOSS.BUTTON_CANCEL.CAPTION" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: tfemboss.button_ok.caption msgctxt "TFEMBOSS.BUTTON_OK.CAPTION" @@ -371,12 +371,12 @@ msgstr "Afrawan" #: tfemboss.label_direction.caption msgctxt "tfemboss.label_direction.caption" msgid "Direction :" -msgstr "Tanila:" +msgstr "Tanila :" #: tffilterfunction.button_cancel.caption msgctxt "tffilterfunction.button_cancel.caption" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: tffilterfunction.button_ok.caption msgctxt "tffilterfunction.button_ok.caption" @@ -389,12 +389,12 @@ msgstr "Snes tawuri" #: tffilterfunction.checkbox_gamma.caption msgid "Gamma correction" -msgstr "" +msgstr "Aseɣti gamma" #: tffilterfunction.checkbox_gsba.caption msgctxt "tffilterfunction.checkbox_gsba.caption" msgid "Corrected hue and lightness" -msgstr "Tasenfelt n yini akked tifawit yettwaseɣtin" +msgstr "Tiɣmi akked tifawit yettwaseɣtan" #: tffilterfunction.label_alphaequals.caption msgctxt "tffilterfunction.label_alphaequals.caption" @@ -433,7 +433,7 @@ msgstr "." #: tffilterfunction.label_variables.caption msgid "Variables :" -msgstr "" +msgstr "Imuttiyen :" #: tffilterfunction.tabsheet_hsl.caption msgid "HSL" @@ -447,7 +447,7 @@ msgstr "RGB" #: tfgeometricbrush.button_cancel.caption msgctxt "tfgeometricbrush.button_cancel.caption" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: tfgeometricbrush.button_ok.caption msgctxt "tfgeometricbrush.button_ok.caption" @@ -460,7 +460,7 @@ msgstr "Amfezwu anzeggan" #: tfgeometricbrush.checkbox_isgradient.caption msgid "Opacity gradient" -msgstr "Tiḍullest n tfesna n yini" +msgstr "Tiḍullest n ufesniw" #: tfgeometricbrush.label1.caption msgid "Number of sides:" @@ -472,15 +472,15 @@ msgstr "Tabdart n tugniwin" #: tfimagelist.pmautouncheckonopen.caption msgid "Autouncheck files after being open" -msgstr "" +msgstr "Tukksa tawurmant n ucraḍ i yifuyla deg ulday" #: tfimagelist.pmautouncheckonsave.caption msgid "Autouncheck files after being edited and saved" -msgstr "" +msgstr "Tukksa tawurmant n ucraḍ i yifuyla ticki ttwaẓergen u kelsen" #: tfimagelist.pmremoveall.caption msgid "Empty image list" -msgstr "" +msgstr "Sureg tabdart n tugniwin" #: tfimagelist.pmremovenonexistent.caption msgid "Remove nonexistent images" @@ -492,7 +492,7 @@ msgstr "Kkes tugniwin ur nettwacreḍ ara" #: tfimagelist.pmunchecknonexistent.caption msgid "Uncheck nonexistent files" -msgstr "" +msgstr "Kkes acraḍ i yifuyla ur nelli ara" #: tfimagelist.stringgrid1.columns[0].title.caption msgctxt "tfimagelist.stringgrid1.columns[0].title.caption" @@ -520,7 +520,7 @@ msgstr "Rnu tugniwin ɣer tebdart" #: tfimagelist.tbautouncheck.hint msgid "Enable/disable autounchecking for processed files" -msgstr "" +msgstr "Sermed/sens acraḍ awurman i yifuyla ittusekkren" #: tfimagelist.tbautozoomfit.hint msgid "Enable/disable autofitting images in the LazPaint window" @@ -553,22 +553,22 @@ msgstr "Ldi tugna tamirant" #: tfimagelist.tbopennext.hint msgctxt "tfimagelist.tbopennext.hint" msgid "Open next image (Alt-Right)" -msgstr "Ldi tugna d-itteddun (Alt-Ayefus)" +msgstr "Ldi tugna tuḍfirt (Alt-Ayefus)" #: tfimagelist.tbopennextsw.hint msgctxt "tfimagelist.tbopennextsw.hint" msgid "Open next image" -msgstr "Ldi tugna d-itteddun" +msgstr "Ldi tugna tuḍfirt" #: tfimagelist.tbopenprev.hint msgctxt "tfimagelist.tbopenprev.hint" msgid "Open previous image (Alt-Left)" -msgstr "Ldi tugna yezrin (Alt-Azelmaḍ)" +msgstr "Ldi tugna tuzwirt (Alt-Azelmaḍ)" #: tfimagelist.tbopenprevsw.hint msgctxt "tfimagelist.tbopenprevsw.hint" msgid "Open previous image" -msgstr "Ldi tugna yezrin" +msgstr "Ldi tugna tuzwirt" #: tfimagelist.tbremoveitem.hint msgid "Remove selected images from list" @@ -576,7 +576,7 @@ msgstr "Kkes tugniwin yettwafernen si tebdart" #: tfimagelist.tbuncheckall.hint msgid "Uncheck all files for processing" -msgstr "" +msgstr "Kkes acraḍ i yifuyla merra i wesekker" #: tflayerstack.caption msgctxt "tflayerstack.caption" @@ -591,12 +591,12 @@ msgstr "Fren tamhelt n usmezdi" #: tflayerstack.toolzoomlayerstackin.hint msgctxt "tflayerstack.toolzoomlayerstackin.hint" msgid "Zoom layer stack in" -msgstr "Semɣer taɣbirt n tissiyin" +msgstr "Semɣer tiɣbirt n tissiyin" #: tflayerstack.toolzoomlayerstackout.hint msgctxt "tflayerstack.toolzoomlayerstackout.hint" msgid "Zoom layer stack out" -msgstr "Simecṭuḥ taɣbirt n tissiyin" +msgstr "Simecṭuḥ tiɣbirt n tissiyin" #: tfloading.caption msgctxt "tfloading.caption" @@ -606,7 +606,7 @@ msgstr "Asali..." #: tfmain.brushcreategeometric.hint msgctxt "tfmain.brushcreategeometric.hint" msgid "Create geometric brush" -msgstr "Snulfu-d amfezwu anzeggan" +msgstr "Snulfu-d amfezzu anzeggan" #: tfmain.brushloadfromfile.hint msgctxt "tfmain.brushloadfromfile.hint" @@ -636,15 +636,15 @@ msgstr "Fren ini" #: tfmain.colorintensity.caption msgid "Intensity..." -msgstr "" +msgstr "Tadwast..." #: tfmain.colorlightness.caption msgid "Brightness / Contrast..." -msgstr "Tifawit / umyeẓli..." +msgstr "Tifawit / Amyeẓli..." #: tfmain.colorposterize.caption msgid "Posterize..." -msgstr "" +msgstr "Abeqqiḍ..." #: tfmain.colorshiftcolors.caption msgctxt "tfmain.colorshiftcolors.caption" @@ -653,15 +653,15 @@ msgstr "Sekḥer initen..." #: tfmain.combobox_penstyle.hint msgid "Pen style" -msgstr "Aɣanib n ukeryun" +msgstr "Aɣanib n yimru" #: tfmain.editcopy.caption msgid "Copy" -msgstr "" +msgstr "Nɣel" #: tfmain.editcopy.hint msgid "Copy selection" -msgstr "" +msgstr "Nɣel tafrayt" #: tfmain.editcut.caption msgid "Cut" @@ -678,12 +678,12 @@ msgstr "Kkes" #: tfmain.editdeleteselection.hint msgid "Delete selection" -msgstr "Kkes ayen yettwafernen" +msgstr "Kkes tafrayt" #: tfmain.editdeselect.hint msgctxt "TFMAIN.EDITDESELECT.HINT" msgid "Deselect" -msgstr "Kkes tafrayt" +msgstr "Sefsex tafrayt" #: tfmain.editinvertselection.hint msgctxt "TFMAIN.EDITINVERTSELECTION.HINT" @@ -709,20 +709,20 @@ msgstr "Mutti d asawen" #: tfmain.editpaste.hint msgctxt "TFMAIN.EDITPASTE.HINT" msgid "Paste" -msgstr "Senteḍ" +msgstr "Senṭeḍ" #: tfmain.editpasteasnew.caption msgid "Paste as new image" -msgstr "Senteḍ am tugna tamaynutt" +msgstr "Senṭeḍ am tugna tamaynutt" #: tfmain.editpasteasnewlayer.caption msgid "Paste as new layer" -msgstr "Senteḍ am tissi tamaynutt" +msgstr "Senṭeḍ am tissi tamaynutt" #: tfmain.editredo.hint msgctxt "TFMAIN.EDITREDO.HINT" msgid "Redo" -msgstr "Uɣal" +msgstr "Err-d" #: tfmain.editselectall.caption msgctxt "tfmain.editselectall.caption" @@ -744,19 +744,19 @@ msgstr "Sgaddi tafrayt" #: tfmain.editshapealignbottom.hint msgid "Align shape to the bottom" -msgstr "Derrec talɣa ukessar" +msgstr "Derrec talɣa s adda" #: tfmain.editshapealignleft.hint msgid "Align shape left" -msgstr "Derrec talɣa ɣer zelmaḍ" +msgstr "Derrec talɣa s azelmaḍ" #: tfmain.editshapealignright.hint msgid "Align shape right" -msgstr "Derrec talɣa ɣer yefus" +msgstr "Derrec talɣa s ayfus" #: tfmain.editshapealigntop.hint msgid "Align shape to the top" -msgstr "Derrec talɣa uksawen" +msgstr "Derrec talɣa s afella" #: tfmain.editshapecenterhorizontally.hint msgid "Center shape horizontally" @@ -772,20 +772,20 @@ msgstr "Err talɣa d azlig" #: tfmain.editundo.caption msgid "Undo" -msgstr "Err-d" +msgstr "Sefsex" #: tfmain.editundo.hint msgid "Undo last modification" -msgstr "Semmet abeddel aneggaru" +msgstr "Sefsex abeddel aneggaru" #: tfmain.embeddedcancel.caption msgctxt "TFMAIN.EMBEDDEDCANCEL.CAPTION" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: tfmain.embeddedcancel.hint msgid "Cancel modifications" -msgstr "Semmet ibeddilen" +msgstr "Sefsex ibeddilen" #: tfmain.embeddedvalidate.caption msgid "Validate" @@ -797,7 +797,7 @@ msgstr "Sentem ibeddilen" #: tfmain.exportpicturedialog.title msgid "Export as..." -msgstr "" +msgstr "Sifeḍ am..." #: tfmain.filechooseentry.caption msgid "Choose entry..." @@ -809,7 +809,7 @@ msgstr "Fren anekcum deg ufaylu" #: tfmain.fileexport.caption msgid "Export..." -msgstr "" +msgstr "Sifeḍ..." #: tfmain.fileimport3d.caption msgid "Import 3D object..." @@ -856,7 +856,7 @@ msgstr "Cfu ɣef umasal n usekles" #: tfmain.filerunscript.caption msgid "Run script..." -msgstr "" +msgstr "Sekker askript..." #: tfmain.filesave.caption msgctxt "TFMAIN.FILESAVE.CAPTION" @@ -887,7 +887,7 @@ msgstr "Sekles tafrayt am..." #: tfmain.fileuseimagebrowser.caption msgctxt "tfmain.fileuseimagebrowser.caption" msgid "Use image browser" -msgstr "Seqdec anarram n tugniwin" +msgstr "Seqdec anaram n tugniwin" #: tfmain.filterblurbox.caption msgid "Box blur..." @@ -958,12 +958,12 @@ msgstr "Snes tawuri..." #: tfmain.filtergrayscale.caption msgid "Grayscale" -msgstr "Taskala n umelliɣdi" +msgstr "Tafesna n umelliɣdi" #: tfmain.filterlinearnegative.caption msgctxt "tfmain.filterlinearnegative.caption" msgid "Linear negative" -msgstr "Uzdir amzireg" +msgstr "Uzdir imzireg" #: tfmain.filtermedian.caption msgid "Median" @@ -993,7 +993,7 @@ msgstr "Spiksel..." #: tfmain.filterplane.caption msgid "Plane (slow)" -msgstr "" +msgstr "Agni (d aẓayan)" #: tfmain.filterrain.caption msgid "Rain..." @@ -1017,7 +1017,7 @@ msgid "Twirl..." msgstr "Abran..." #: tfmain.filterwavedisplacement.caption -msgid "Wave displacement..." +msgid "Wave diplacement..." msgstr "Asekḥer n tayyugt..." #: tfmain.forgetdialoganswers.caption @@ -1026,7 +1026,7 @@ msgstr "Ttu tiririyin n tenkult n udiwenni" #: tfmain.forgetdialoganswers.hint msgid "Forget answers given to dialog boxes" -msgstr "Ttu tiririyin ittunefkrn i tenkulin n udiwenni" +msgstr "Ttu tiririyin ittunefken i tenkulin n udiwenni" #: tfmain.helpabout.caption msgid "About..." @@ -1046,11 +1046,11 @@ msgstr "Sfeḍ abadu alfa yerna sbadu agilal" #: tfmain.imagecrop.caption msgid "Crop to selection" -msgstr "Ɣeẓ alama d tafrayt" +msgstr "Ɣeẓ arma d tafrayt" #: tfmain.imagecroplayer.caption msgid "Crop to selection and current layer" -msgstr "" +msgstr "Ɣeẓ arma d tafrayt akked tissi tamirant" #: tfmain.imagefillbackground.caption msgid "Fill background with antialiasing" @@ -1073,7 +1073,7 @@ msgstr "Zzi tugna s uglawi" #: tfmain.imagelinearnegative.caption msgctxt "tfmain.imagelinearnegative.caption" msgid "Linear negative" -msgstr "Uzdir amzireg" +msgstr "Uzdir imzireg" #: tfmain.imagenegative.caption msgctxt "tfmain.imagenegative.caption" @@ -1094,11 +1094,11 @@ msgstr "Ales alemmec i tugna" #: tfmain.imagerotateccw.caption msgid "Rotate 90° CCW" -msgstr "Tuzzya 90° (mgal tamrilt)" +msgstr "Tuzzya 90° (mgal tanila n temrilt)" #: tfmain.imagerotatecw.caption msgid "Rotate 90° CW" -msgstr "Tuzzya 90° (tamrilt)" +msgstr "Tuzzya 90° (di tnila n temrilt)" #: tfmain.imagesmartzoom3.caption msgid "Smart zoom x3" @@ -1143,7 +1143,7 @@ msgstr "Agdil aččuran" #: tfmain.itemuseimagebrowser.caption msgctxt "tfmain.itemuseimagebrowser.caption" msgid "Use image browser" -msgstr "Seqdec anarram n tugniwin" +msgstr "Seqdec anaram n tugniwin" #: tfmain.itemviewdocktoolbox.caption msgid "Dock toolbox" @@ -1216,7 +1216,7 @@ msgstr "Tehri" #: tfmain.label_pen.caption msgctxt "TFMAIN.LABEL_PEN.CAPTION" msgid "Pen" -msgstr "Akeryun" +msgstr "Imru" #: tfmain.label_penwidth.caption msgctxt "tfmain.label_penwidth.caption" @@ -1332,11 +1332,11 @@ msgstr "Sken tafeggagt n ifecka Nɣel/Senteḍ" #: tfmain.menudocktoolboxleft.caption msgid "Dock left" -msgstr "Semdey ɣer zelmaḍ" +msgstr "Semdey s azelmaḍ" #: tfmain.menudocktoolboxright.caption msgid "Dock right" -msgstr "Semdey ɣer yefus" +msgstr "Semdey s ayfus" #: tfmain.menuedit.caption msgctxt "tfmain.menuedit.caption" @@ -1374,7 +1374,7 @@ msgstr "Tutlayt" #: tfmain.menuradialblur.caption msgctxt "tfmain.menuradialblur.caption" msgid "Radial blur" -msgstr "Aluɣu azenẓaran" +msgstr "Aluɣu aẓenẓaran" #: tfmain.menurecentfiles.caption msgctxt "tfmain.menurecentfiles.caption" @@ -1392,7 +1392,6 @@ msgid "Render" msgstr "Tiririt" #: tfmain.menuscript.caption -#, fuzzy msgctxt "tfmain.menuscript.caption" msgid "Script" msgstr "Askript" @@ -1418,7 +1417,7 @@ msgstr "Kkes asemdey" #: tfmain.menuundoredotoolbar.caption msgid "Show undo/redo toolbar" -msgstr "Sken tafeggagt n ifecka err-d/uɣal" +msgstr "Sken tafeggagt n ifecka sefsex/err-d" #: tfmain.menuview.caption msgctxt "tfmain.menuview.caption" @@ -1436,7 +1435,7 @@ msgstr "Kter taɣawsa 3D" #: tfmain.openbrushdialog.title msgid "Open brush" -msgstr "Sali-d amfezzu" +msgstr "Ldi amfezzu" #: tfmain.openpicturedialog1.title msgctxt "TFMAIN.OPENPICTUREDIALOG1.TITLE" @@ -1556,7 +1555,7 @@ msgstr "Tiḍullest n tsemsut" #: tfmain.spinedit_penwidth.hint msgctxt "tfmain.spinedit_penwidth.hint" msgid "Pen width" -msgstr "Tehri n ukeryun" +msgstr "Tehri n yimru" #: tfmain.spinedit_phongbordersize.hint msgctxt "tfmain.spinedit_phongbordersize.hint" @@ -1601,11 +1600,11 @@ msgstr "Amfezzu" #: tfmain.toolchangedocking.hint msgctxt "tfmain.toolchangedocking.hint" msgid "Change docking" -msgstr "Snifel tamdeyt" +msgstr "Snifel asemdey" #: tfmain.toolclone.hint msgid "Clone tool" -msgstr "" +msgstr "Afecku n usisleg" #: tfmain.toolcolorpicker.hint msgctxt "TFMAIN.TOOLCOLORPICKER.HINT" @@ -1640,11 +1639,11 @@ msgstr "Taqbuct n teklut" #: tfmain.toolgradient.caption msgid "Gradient" -msgstr "Tafesna n yini" +msgstr "Afesniw" #: tfmain.toolgradient.hint msgid "Render gradient" -msgstr "Tafesna n yini n tririt" +msgstr "Afesniw n tririt" #: tfmain.toolhand.caption msgid "Hand" @@ -1683,16 +1682,16 @@ msgstr "Smutti tafrayt" #: tfmain.toolopenedcurve.hint msgid "Opened curve" -msgstr "" +msgstr "Azlig yeldin" #: tfmain.toolpen.caption msgctxt "TFMAIN.TOOLPEN.CAPTION" msgid "Pen" -msgstr "Akeryun" +msgstr "Imru" #: tfmain.toolpen.hint msgid "Simple pen" -msgstr "Akeryun aḥerfi" +msgstr "Imru aḥerfi" #: tfmain.toolphong.hint msgctxt "TFMAIN.TOOLPHONG.HINT" @@ -1701,15 +1700,15 @@ msgstr "Taɣawsa s tili" #: tfmain.toolpolygon.caption msgid "Polygon" -msgstr "Ageddis" +msgstr "Izirig yerreẓen" #: tfmain.toolpolygon.hint msgid "Polygon or polyline" -msgstr "Ageddis neɣ izirig yerrẓen" +msgstr "Ageddis neɣ izirig yerreẓen" #: tfmain.toolpolyline.hint msgid "Polyline" -msgstr "" +msgstr "Izirig yerreẓen" #: tfmain.toolrect.hint msgctxt "TFMAIN.TOOLRECT.HINT" @@ -1729,17 +1728,17 @@ msgstr "Fren taglayt" #: tfmain.toolselectpen.caption msgctxt "tfmain.toolselectpen.caption" msgid "Selection pen" -msgstr "Akeryun n tefrayt" +msgstr "Imru n tefrayt" #: tfmain.toolselectpen.hint msgctxt "tfmain.toolselectpen.hint" msgid "Draw selection with pen" -msgstr "Suneɣ tafrayt s ukeryun" +msgstr "Suneɣ tafrayt s yimru" #: tfmain.toolselectpoly.hint msgctxt "TFMAIN.TOOLSELECTPOLY.HINT" msgid "Select polygon" -msgstr "Fren ageddis" +msgstr "Izirig yerreẓen" #: tfmain.toolselectrect.hint msgctxt "TFMAIN.TOOLSELECTRECT.HINT" @@ -1810,7 +1809,7 @@ msgstr "Suneɣ azlig" #: tfmain.tool_curvemovepoint.hint msgid "Move point" -msgstr "Smutti tinqiḍin" +msgstr "Smutti tanqiḍt" #: tfmain.tool_drawshapeborder.hint msgctxt "tfmain.tool_drawshapeborder.hint" @@ -1829,15 +1828,15 @@ msgstr "Silweɣ" #: tfmain.tool_erasedarken.hint msgid "Darken" -msgstr "" +msgstr "Ssibrik" #: tfmain.tool_eraselighten.hint msgid "Lighten" -msgstr "" +msgstr "Ssfaw" #: tfmain.tool_erasesharpen.hint msgid "Sharpen" -msgstr "" +msgstr "Semsed" #: tfmain.tool_fillshape.hint msgctxt "tfmain.tool_fillshape.hint" @@ -1911,15 +1910,15 @@ msgstr "Taqbuct n teklut tafarayt" #: tfmain.tool_textaligncenter.hint msgid "Center" -msgstr "" +msgstr "Talemmast" #: tfmain.tool_textalignleft.hint msgid "Align left" -msgstr "" +msgstr "Derrec s azelmaḍ" #: tfmain.tool_textalignright.hint msgid "Align right" -msgstr "" +msgstr "Derrec s ayfus" #: tfmain.tool_textfont.hint msgctxt "TFMAIN.TOOL_TEXTFONT.HINT" @@ -1948,7 +1947,7 @@ msgstr "Initen" #: tfmain.viewdarktheme.caption msgid "Dark theme" -msgstr "" +msgstr "Asentel aberkan" #: tfmain.viewgrid.caption msgctxt "TFMAIN.VIEWGRID.CAPTION" @@ -1972,7 +1971,7 @@ msgstr "Sken tissiyin" #: tfmain.viewlayerstackbutton.hint msgctxt "tfmain.viewlayerstackbutton.hint" msgid "Show or hide layer stack window" -msgstr "Sken neɣ ffer taɣbirt n tissiyin" +msgstr "Sken neɣ ffer asfaylu n teɣbirt n tissiyin" #: tfmain.viewpalette.caption msgctxt "tfmain.viewpalette.caption" @@ -1989,7 +1988,7 @@ msgstr "Tankult n ifecka" #: tfmain.viewworkspacecolor.caption msgid "Set workspace color..." -msgstr "Sbadu ini n tallunt n umahil..." +msgstr "Seɣwer ini n tallunt n umahil..." #: tfmain.viewzoomfit.caption msgctxt "tfmain.viewzoomfit.caption" @@ -1999,7 +1998,7 @@ msgstr "Sezg asemɣer" #: tfmain.viewzoomfit.hint msgctxt "TFMAIN.VIEWZOOMFIT.HINT" msgid "Zoom to fit in the window" -msgstr "Sezg asemɣer ɣer usfaylu" +msgstr "Semɣer iwakken ad tsizgeḍ s asfaylu" #: tfmain.viewzoomin.hint msgctxt "TFMAIN.VIEWZOOMIN.HINT" @@ -2013,7 +2012,7 @@ msgstr "Tiddi n tazwara" #: tfmain.viewzoomoriginal.hint msgid "Zoom to original pixel size" -msgstr "" +msgstr "Zoom ɣer tiddi n tazwara n upiksel" #: tfmain.viewzoomout.hint msgctxt "TFMAIN.VIEWZOOMOUT.HINT" @@ -2023,7 +2022,7 @@ msgstr "Simecṭuḥ" #: tfmotionblur.button_cancel.caption msgctxt "TFMOTIONBLUR.BUTTON_CANCEL.CAPTION" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: tfmotionblur.button_ok.caption msgctxt "TFMOTIONBLUR.BUTTON_OK.CAPTION" @@ -2033,7 +2032,7 @@ msgstr "Ih" #: tfmotionblur.caption msgctxt "tfmotionblur.caption" msgid "Motion blur" -msgstr "" +msgstr "Aluɣu yettemwwiwilen" #: tfmotionblur.checkbox_oriented.caption msgid "Oriented" @@ -2047,7 +2046,7 @@ msgstr "Ameccaq :" #: tfmultiimage.button_cancel.caption msgctxt "tfmultiimage.button_cancel.caption" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: tfmultiimage.button_ok.caption msgctxt "tfmultiimage.button_ok.caption" @@ -2061,7 +2060,7 @@ msgstr "Fren tugna" #: tfnewimage.button_cancel.caption msgctxt "TFNEWIMAGE.BUTTON_CANCEL.CAPTION" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: tfnewimage.button_ok.caption msgctxt "TFNEWIMAGE.BUTTON_OK.CAPTION" @@ -2075,11 +2074,11 @@ msgstr "Tugna tamaynutt" #: tfnewimage.combobox_bitdepth.text msgid "32" -msgstr "" +msgstr "32" #: tfnewimage.label_bitdepth.caption msgid "Bit depth :" -msgstr "" +msgstr "Telqey n ubit :" #: tfnewimage.label_height.caption msgctxt "tfnewimage.label_height.caption" @@ -2092,7 +2091,7 @@ msgstr "Assaɣ :" #: tfnewimage.label_memoryrequired.caption msgid "Memory required :" -msgstr "Takatut yettawasran :" +msgstr "Takatut yettwasran :" #: tfnewimage.label_width.caption msgctxt "tfnewimage.label_width.caption" @@ -2102,7 +2101,7 @@ msgstr "Tehri :" #: tfnoisefilter.button_cancel.caption msgctxt "tfnoisefilter.button_cancel.caption" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: tfnoisefilter.button_ok.caption msgctxt "tfnoisefilter.button_ok.caption" @@ -2128,7 +2127,7 @@ msgstr "Asxerxec RGB" #: tfobject3d.button_cancel.caption msgctxt "tfobject3d.button_cancel.caption" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: tfobject3d.button_loadtex.caption msgid "Texture..." @@ -2136,7 +2135,7 @@ msgstr "Tizḍi..." #: tfobject3d.button_notex.caption msgid "No tex." -msgstr "" +msgstr "Ulac." #: tfobject3d.button_ok.caption msgctxt "tfobject3d.button_ok.caption" @@ -2153,11 +2152,11 @@ msgstr "Amzay" #: tfobject3d.checkbox_biface.caption msgid "2-sided faces" -msgstr "" +msgstr "Udmawen s 2 idisan" #: tfobject3d.checkbox_textureinterp.caption msgid "Texture interpolation" -msgstr "Asenteḍ n tizḍi" +msgstr "Asenṭeḍ n tizḍi" #: tfobject3d.groupbox_selectedlight.caption msgid "Selected light" @@ -2171,7 +2170,7 @@ msgstr "Ingawen yettwafernen" #: tfobject3d.label_color.caption msgctxt "tfobject3d.label_color.caption" msgid "Color :" -msgstr "Ini:" +msgstr "Ini :" #: tfobject3d.label_color1.caption msgctxt "tfobject3d.label_color1.caption" @@ -2186,7 +2185,7 @@ msgstr "Teɣzi :" #: tfobject3d.label_lightingnormals.caption msgctxt "tfobject3d.label_lightingnormals.caption" msgid "Lighting normals :" -msgstr "" +msgstr "Asfaw amagnu :" #: tfobject3d.label_lights.caption msgid "Lights :" @@ -2195,17 +2194,17 @@ msgstr "Iɣbula n tafat :" #: tfobject3d.label_materials.caption msgctxt "tfobject3d.label_materials.caption" msgid "Materials :" -msgstr "Ingawen:" +msgstr "Ingawen :" #: tfobject3d.label_opacity.caption msgctxt "tfobject3d.label_opacity.caption" msgid "Opacity :" -msgstr "Tiḍullest:" +msgstr "Tiḍullest :" #: tfobject3d.label_specularindex.caption msgctxt "tfobject3d.label_specularindex.caption" msgid "Spec. index :" -msgstr "" +msgstr "Amatar :" #: tfobject3d.label_width.caption msgctxt "tfobject3d.label_width.caption" @@ -2249,7 +2248,7 @@ msgstr "Kkes tafat yettwafernen" #: tfphongfilter.button_cancel.caption msgctxt "tfphongfilter.button_cancel.caption" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: tfphongfilter.button_ok.caption msgctxt "tfphongfilter.button_ok.caption" @@ -2272,11 +2271,11 @@ msgstr "Takarḍa n tattayt" #: tfphongfilter.label_altitude.caption msgid "Global altitude :" -msgstr "" +msgstr "Tattayt tajemmalt :" #: tfphongfilter.label_lightposition.caption msgid "Light position :" -msgstr "Ideg n tafat:" +msgstr "Ideg n tafat :" #: tfphongfilter.radio_mapalpha.caption msgid "Alpha" @@ -2293,11 +2292,11 @@ msgstr "V" #: tfphongfilter.radio_maplightness.caption msgctxt "tfphongfilter.radio_maplightness.caption" msgid "Lightness" -msgstr "Tafat" +msgstr "Tifawit" #: tfphongfilter.radio_maplinearlightness.caption msgid "Linear lightness" -msgstr "Tafat timziregt" +msgstr "Tifawit timziregt" #: tfphongfilter.radio_mapred.caption msgid "R" @@ -2318,7 +2317,7 @@ msgstr "Ḥrez" #: tfphongfilter.radio_usepencolor.caption msgid "Pen color" -msgstr "Ini n ukeryun" +msgstr "Ini n yimru" #: tfphongfilter.radio_usetexture.caption msgctxt "tfphongfilter.radio_usetexture.caption" @@ -2328,7 +2327,7 @@ msgstr "Tizḍi tamirant" #: tfpixelate.button_cancel.caption msgctxt "TFPIXELATE.BUTTON_CANCEL.CAPTION" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: tfpixelate.button_ok.caption msgctxt "TFPIXELATE.BUTTON_OK.CAPTION" @@ -2348,12 +2347,12 @@ msgstr "Tiddi n upiksel :" #: tfpixelate.label_quality.caption msgctxt "tfpixelate.label_quality.caption" msgid "Quality :" -msgstr "" +msgstr "Taɣara :" #: tfposterize.button_cancel.caption msgctxt "tfposterize.button_cancel.caption" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: tfposterize.button_ok.caption msgctxt "tfposterize.button_ok.caption" @@ -2363,11 +2362,11 @@ msgstr "Ih" #: tfposterize.caption msgctxt "tfposterize.caption" msgid "Posterize" -msgstr "" +msgstr "Abeqqiḍ" #: tfposterize.checkbox_bylightness.caption msgid "By lightness" -msgstr "S tafat" +msgstr "S tifawit" #: tfposterize.label_levels.caption msgid "Levels :" @@ -2414,7 +2413,7 @@ msgstr "Tamiwin" #: tfprint.label_bottom.caption msgid "Bottom:" -msgstr "Ukessar :" +msgstr "Ukessar:" #: tfprint.label_dpix.caption msgctxt "tfprint.label_dpix.caption" @@ -2432,19 +2431,19 @@ msgstr "Teɣzi:" #: tfprint.label_left.caption msgid "Left:" -msgstr "Zelmaḍ :" +msgstr "Azelmaḍ:" #: tfprint.label_orientation.caption msgid "Orientation:" -msgstr "Taɣda :" +msgstr "Taɣda:" #: tfprint.label_printerandpaper.caption msgid "Printer and paper:" -msgstr "Tasaggazt akked ukaɣeḍ :" +msgstr "Tasaggazt akked ukaɣeḍ:" #: tfprint.label_right.caption msgid "Right:" -msgstr "Yefus :" +msgstr "Ayfus:" #: tfprint.label_top.caption msgid "Top:" @@ -2470,7 +2469,7 @@ msgstr "." #: tfradialblur.button_cancel.caption msgctxt "TFRADIALBLUR.BUTTON_CANCEL.CAPTION" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: tfradialblur.button_ok.caption msgctxt "TFRADIALBLUR.BUTTON_OK.CAPTION" @@ -2480,7 +2479,7 @@ msgstr "Ih" #: tfradialblur.caption msgctxt "tfradialblur.caption" msgid "Radial blur" -msgstr "Aluɣu azenẓaran" +msgstr "Aluɣu aẓenẓaran" #: tfradialblur.label_radius.caption msgctxt "tfradialblur.label_radius.caption" @@ -2490,7 +2489,7 @@ msgstr "Aqqar :" #: tfrain.button_cancel.caption msgctxt "tfrain.button_cancel.caption" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: tfrain.button_ok.caption msgctxt "tfrain.button_ok.caption" @@ -2512,7 +2511,7 @@ msgstr "Aḍu :" #: tfresample.button_cancel.caption msgctxt "TFRESAMPLE.BUTTON_CANCEL.CAPTION" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: tfresample.button_ok.caption msgctxt "TFRESAMPLE.BUTTON_OK.CAPTION" @@ -2532,12 +2531,12 @@ msgstr "Ḥrez assaɣ n tmeẓri" #: tfresample.label_height.caption msgctxt "tfresample.label_height.caption" msgid "Height :" -msgstr "Teɣzi:" +msgstr "Teɣzi :" #: tfresample.label_quality.caption msgctxt "tfresample.label_quality.caption" msgid "Quality :" -msgstr "" +msgstr "Taɣara :" #: tfresample.label_width.caption msgctxt "tfresample.label_width.caption" @@ -2547,7 +2546,7 @@ msgstr "Tehri :" #: tfsaveoption.button_cancel.caption msgctxt "tfsaveoption.button_cancel.caption" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: tfsaveoption.button_ok.caption msgctxt "tfsaveoption.button_ok.caption" @@ -2561,11 +2560,11 @@ msgstr "Sekles" #: tfsaveoption.checkbox_dithering.caption msgid "Dithering" -msgstr "" +msgstr "Tizḍi" #: tfsaveoption.label1.caption msgid "Quality:" -msgstr "" +msgstr "Taɣara:" #: tfsaveoption.label_0.caption msgid "0" @@ -2614,7 +2613,7 @@ msgstr "MioMap" #: tfsharpen.button_cancel.caption msgctxt "tfsharpen.button_cancel.caption" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: tfsharpen.button_ok.caption msgctxt "tfsharpen.button_ok.caption" @@ -2633,7 +2632,7 @@ msgstr "Tasmekta :" #: tfshiftcolors.button_cancel.caption msgctxt "TFSHIFTCOLORS.BUTTON_CANCEL.CAPTION" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: tfshiftcolors.button_ok.caption msgctxt "TFSHIFTCOLORS.BUTTON_OK.CAPTION" @@ -2648,12 +2647,12 @@ msgstr "Sekḥer initen" #: tfshiftcolors.checkbox_gsba.caption msgctxt "tfshiftcolors.checkbox_gsba.caption" msgid "Corrected hue and lightness" -msgstr "Tasenfelt n yini akked tifawit yettwaseɣtin" +msgstr "Tiɣmi akked tifawit yettwaseɣtan" #: tfshiftcolors.label1.caption msgctxt "TFSHIFTCOLORS.LABEL1.CAPTION" msgid "Hue" -msgstr "Tasenfelt n yini" +msgstr "Tiɣmi" #: tfshiftcolors.label2.caption msgctxt "TFSHIFTCOLORS.LABEL2.CAPTION" @@ -2668,7 +2667,7 @@ msgstr "Ifecka" #: tftwirl.button_cancel.caption msgctxt "TFTWIRL.BUTTON_CANCEL.CAPTION" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: tftwirl.button_ok.caption msgctxt "TFTWIRL.BUTTON_OK.CAPTION" @@ -2693,7 +2692,7 @@ msgstr "Aqqar :" #: tfwavedisplacement.button_cancel.caption msgctxt "tfwavedisplacement.button_cancel.caption" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: tfwavedisplacement.button_ok.caption msgctxt "tfwavedisplacement.button_ok.caption" @@ -2734,7 +2733,7 @@ msgstr "akk" #: uresourcestrings.rsallsupportedfiletypes msgid "All supported filetypes" -msgstr "Akk imasalen yettwassnen" +msgstr "Akk imasalen itteddun" #: uresourcestrings.rsalt msgid "ALT" @@ -2755,7 +2754,7 @@ msgstr "Ssed BACKSPACE iwakken ad tekkseḍ tanqiḍt taneggarut" #: uresourcestrings.rsbestquality msgctxt "uresourcestrings.rsbestquality" msgid "Best quality" -msgstr "" +msgstr "Taɣara igerrzen maḍi" #: uresourcestrings.rsbitmap msgid "Bitmap" @@ -2775,16 +2774,16 @@ msgstr "Tifawit" #: uresourcestrings.rsbytes msgid "Bytes" -msgstr "Itamḍanen" +msgstr "Iṭamḍanen" #: uresourcestrings.rscancel msgctxt "uresourcestrings.rscancel" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: uresourcestrings.rscancelledbyuser msgid "Cancelled by user" -msgstr "" +msgstr "Isfesx-it useqdac" #: uresourcestrings.rscannotdrawshapeonsvglayer msgid "Cannot draw shape on SVG layer" @@ -2823,19 +2822,19 @@ msgstr "Initen" #: uresourcestrings.rsconfirmdeletefromcontainer msgid "Are you sure you want to delete this file from the container?" -msgstr "D tidet tebɣiḍ ad tekkseḍ afaylu-agi seg unagbar?" +msgstr "D tidet tebɣiḍ ad tekkseḍ afaylu-agi seg unagbar ?" #: uresourcestrings.rsconfirmdeletemultiplefromcontainer msgid "Are you sure you want to delete these %1 files from the container?" -msgstr "D tidet tebɣiḍ ad tekkseḍ %1 n ifuyla-agi seg unagbar?" +msgstr "D tidet tebɣiḍ ad tekkseḍ %1 n yifuyla-agi seg unagbar ?" #: uresourcestrings.rsconfirmmovemultipletotrash msgid "Are you sure you want to move these %1 files to the trash?" -msgstr "D tidet tebɣiḍ ad terreḍ %1 n ifuyla-agi ɣer tqecwalt?" +msgstr "D tidet tebɣiḍ ad terreḍ %1 n yifuyla-agi ɣer tqecwalt ?" #: uresourcestrings.rsconfirmmovetotrash msgid "Are you sure you want to move this file to the trash?" -msgstr "D tidet tebɣiḍ ad terreḍ afaylu-agi ɣer tqecwalt?" +msgstr "D tidet tebɣiḍ ad terreḍ afaylu-agi ɣer tqecwalt ?" #: uresourcestrings.rsconflictingactions msgid "Conflicting actions" @@ -2848,17 +2847,17 @@ msgstr "Amyeẓli" #: uresourcestrings.rscorrectedhueccw msgctxt "uresourcestrings.rscorrectedhueccw" msgid "Corr. Hue CCW" -msgstr "" +msgstr "Tiɣmi ittuseɣtin mgal tamrilt" #: uresourcestrings.rscorrectedhuecw msgctxt "uresourcestrings.rscorrectedhuecw" msgid "Corr. Hue CW" -msgstr "" +msgstr "Tiɣmi ittuseɣtin di tnila n temrilt" #: uresourcestrings.rscosine msgctxt "uresourcestrings.rscosine" msgid "Cosine" -msgstr "" +msgstr "Akusinus" #: uresourcestrings.rscrop msgid "Crop" @@ -2870,7 +2869,7 @@ msgstr "CTRL" #: uresourcestrings.rscurvemodehint msgid "Press S or X to set the curve mode of the last point" -msgstr "Ssed S neɣ X iwakken ad tbeddeleḍ askar n uzlig i tenqiḍt taneggarut" +msgstr "Ssed S neɣ X iwakken ad tesɣewreḍ askar n uzlig i tenqiḍt taneggarut" #: uresourcestrings.rsdefaultpalette msgid "Default palette" @@ -2891,7 +2890,7 @@ msgstr "Akaram mačči d ilem" #: uresourcestrings.rsditherlayerusingpalette msgid "Dither layer using palette" -msgstr "" +msgstr "Ezḍ tissi s useqec n tpaliḍt" #: uresourcestrings.rsduplicateimage msgid "Duplicate image" @@ -2921,11 +2920,11 @@ msgstr "Tafrayt d tilemt" #: uresourcestrings.rsendwithoutmatchingbegin msgid "End without matching begin" -msgstr "" +msgstr "Taggara war tazwara inmeɣran" #: uresourcestrings.rsenterfolderorcontainername msgid "Enter name for new folder or container (using RES or LRS extension):" -msgstr "Sekcem isem n ukaram neɣ n unagbar (s ttawil n usiɣzef RES neɣ LRS) :" +msgstr "Sekcem isem n ukaram neɣ n unagbar (s useqdec n usiɣzef RES neɣ LRS) :" #: uresourcestrings.rsenterlayername msgid "Enter layer name:" @@ -2941,11 +2940,11 @@ msgstr "Tuccḍa" #: uresourcestrings.rserrordecodingraw msgid "Error decoding raw image." -msgstr "" +msgstr "Tuccḍa di tukksa n tengalt i tugna raw." #: uresourcestrings.rserrorloadingoriginal msgid "Error while loading original however layer can be rasterized." -msgstr "" +msgstr "Tuccḍa deg usali n uneṣli acu kan tissi tezmer ad tettuspiksel." #: uresourcestrings.rserroronopeningfile msgid "Error on opening file \"%1\"" @@ -2953,7 +2952,7 @@ msgstr "Tuccḍa deg ulday n ufaylu \"%1\"" #: uresourcestrings.rsexception msgid "An exception was encountered" -msgstr "" +msgstr "Nemlal-d tasurift" #: uresourcestrings.rsexitrequest msgctxt "uresourcestrings.rsexitrequest" @@ -3000,7 +2999,7 @@ msgstr "Isem n ufaylu" #: uresourcestrings.rsfilenotfound msgid "File not found!" -msgstr "Afaylu ur yettwaf ara!" +msgstr "Afaylu ur yettwaf ara !" #: uresourcestrings.rsfilenotsaved msgid "File not saved" @@ -3012,7 +3011,7 @@ msgstr "Tiddi" #: uresourcestrings.rsfilesystem msgid "File system" -msgstr "Anagraw n ifuyla" +msgstr "Anagraw n yifuyla" #: uresourcestrings.rsfiletype msgid "Type" @@ -3049,7 +3048,7 @@ msgstr "Azegzaw" #: uresourcestrings.rshalfcosine msgctxt "uresourcestrings.rshalfcosine" msgid "Half-cosine" -msgstr "" +msgstr "Azgen-kusinus" #: uresourcestrings.rsholdkeyforsquare msgid "Hold %1 to draw a square or a circle" @@ -3061,7 +3060,7 @@ msgstr "Ssed %1 iwakken ad tḥettemeḍ tiɣmert n tuzzya" #: uresourcestrings.rsholdkeysnaptopixel msgid "Hold %1 to snap to pixels" -msgstr "" +msgstr "Ssed ɣef %1 iwakken ad teṭṭfeḍ ɣer ipikselen" #: uresourcestrings.rsholdkeysscalemode msgid "Hold %1 or %2 to scale" @@ -3075,17 +3074,17 @@ msgstr "Tinqiḍin n uḥulfu" #: uresourcestrings.rshue msgctxt "uresourcestrings.rshue" msgid "Hue" -msgstr "Tasenfelt n yini" +msgstr "Tiɣmi" #: uresourcestrings.rshueccw msgctxt "uresourcestrings.rshueccw" msgid "Hue CCW" -msgstr "" +msgstr "Tiɣmi mgal tamrilt" #: uresourcestrings.rshuecw msgctxt "uresourcestrings.rshuecw" msgid "Hue CW" -msgstr "" +msgstr "Tiɣmi di tnila n temrilt" #: uresourcestrings.rsiconimagealreadyexists msgid "There is already an image with this size and depth." @@ -3102,7 +3101,7 @@ msgstr "Tiddi n tignit" #: uresourcestrings.rsimagetoobig msgid "Image is too big" -msgstr "Tugna bezzaf temeqqer" +msgstr "Tugna temeqqer aṭas" #: uresourcestrings.rsinfinity msgctxt "uresourcestrings.rsinfinity" @@ -3116,7 +3115,7 @@ msgstr "Talɣut" #: uresourcestrings.rsintensity msgctxt "uresourcestrings.rsintensity" msgid "Intensity" -msgstr "" +msgstr "Tadwast" #: uresourcestrings.rsinternalerror msgid "Internal error" @@ -3132,7 +3131,7 @@ msgstr "Tiḍullest d tarmeɣtut : " #: uresourcestrings.rsinvalidparameters msgid "Invalid parameters" -msgstr "" +msgstr "Iɣewwaren imeɣta" #: uresourcestrings.rsinvalidresamplesize msgid "Invalid resample size : " @@ -3140,7 +3139,7 @@ msgstr "Tiddi n wallus n ulemmec d tarmeɣtut : " #: uresourcestrings.rsinvalidsizefornew msgid "Invalid size for new : " -msgstr "" +msgstr "Tiddi d tarmeɣtut i umaynut : " #: uresourcestrings.rskeepchanges msgctxt "uresourcestrings.rskeepchanges" @@ -3149,7 +3148,7 @@ msgstr "Tebɣiḍ ad tḥerzeḍ ibeddilen?" #: uresourcestrings.rskeepemptyspace msgid "Keep empty space around opaque pixels?" -msgstr "Tebɣiḍ ad tḥerzeḍ tallunt izin ɣef ipiksilen imḍullesen?" +msgstr "Tebɣiḍ ad tḥerzeḍ tallunt izin ɣef ipikselen imḍullesen ?" #: uresourcestrings.rslanczos msgid "Lanczos %1" @@ -3187,10 +3186,9 @@ msgid "Light" msgstr "Tafat" #: uresourcestrings.rslightness -#, fuzzy msgctxt "uresourcestrings.rslightness" msgid "Lightness" -msgstr "Tafat" +msgstr "Tifawit" #: uresourcestrings.rslightposition msgid "Light position" @@ -3207,7 +3205,7 @@ msgstr "RGB imzireg" #: uresourcestrings.rsloadandmergepalette msgid "Load and merge palette..." -msgstr "Sali yerna smezdi tapaliḍt..." +msgstr "Sali-d yerna smezdi tapaliḍt..." #: uresourcestrings.rsloading msgid "Loading" @@ -3219,7 +3217,7 @@ msgstr "Sali-d tapaliḍt..." #: uresourcestrings.rsloopcount msgid "Loop count" -msgstr "" +msgstr "Allus" #: uresourcestrings.rsmakencolorspalettefrombitmap msgid "Make %1-colors palette from image" @@ -3227,7 +3225,7 @@ msgstr "Eg tapaliḍt n %1 n yiniten seg tugna" #: uresourcestrings.rsmergeselection msgid "Do you want to merge selection?" -msgstr "Tebɣiḍ ad tesmezdiḍ tafrayt?" +msgstr "Tebɣiḍ ad tesmezdiḍ tafrayt ?" #: uresourcestrings.rsmitchell msgctxt "uresourcestrings.rsmitchell" @@ -3249,7 +3247,7 @@ msgstr "Isefk di tazwara ad teslelliḍ tafrayt" #: uresourcestrings.rsmustshowlayer msgid "You must first make the layer visible" -msgstr "" +msgstr "Isefk di tazwara ad terreḍ tissi tettban" #: uresourcestrings.rsnetworkdrive msgid "Network" @@ -3318,7 +3316,7 @@ msgstr "Ldi" #: uresourcestrings.rsopenfilesaslayers msgid "Open files as layers in a single image" -msgstr "Ldi ifuyla amzun d tissiyin n yiwet n tugna" +msgstr "Ldi ifuyla amzun d tissiyin deg yiwet n tugna" #: uresourcestrings.rsopenfirstfileonly msgid "Open the first file only" @@ -3330,7 +3328,7 @@ msgstr "Alday" #: uresourcestrings.rsopenmultipleimagefiles msgid "Open multiple image files" -msgstr "Ldi aṭṭas n ifuyla n tugniwin" +msgstr "Ldi aṭṭas n yifuyla n tugniwin" #: uresourcestrings.rsotherblendop msgid "Other..." @@ -3338,11 +3336,11 @@ msgstr "Wayeḍ..." #: uresourcestrings.rsoverwritefile msgid "File already exists. Do you want to overwrite it?" -msgstr "Afaylu yella yakan. Tebɣiḍ ad t-tesemselsiḍ?" +msgstr "Afaylu yella yakan. Tebɣiḍ ad t-tesemselsiḍ ?" #: uresourcestrings.rspaletteincludesalphachannel msgid "Palette includes alpha channel" -msgstr "Seddu abadu alfa di tpaliḍt" +msgstr "Tapaliḍt ad tseddu abadu alfa" #: uresourcestrings.rspaletteoptions msgid "Palette options" @@ -3359,7 +3357,7 @@ msgstr "S teɣzi" #: uresourcestrings.rsposterizelayerusingpalette msgid "Posterize layer using palette" -msgstr "" +msgstr "Talɣa n ubeqqiḍ i tissi s useqdec n tpaliḍt" #: uresourcestrings.rspresetname msgid "Preset name" @@ -3370,8 +3368,8 @@ msgid "px" msgstr "px" #: uresourcestrings.rspythonunexpectedversion -msgid "Expected Python version %1 but %2 found." -msgstr "" +msgid "Expected python version %1 but %2 found." +msgstr "Yetturaǧu lqem n python %1 maca nufa %2." #: uresourcestrings.rsramdisk msgid "RAM disk" @@ -3379,7 +3377,7 @@ msgstr "RAM aḍebsi" #: uresourcestrings.rsrasterlayer msgid "Raster layer" -msgstr "Tissi s ipiksilen" +msgstr "Tissi s ipikselen" #: uresourcestrings.rsrecentdirectories msgid "Recent directories:" @@ -3396,7 +3394,7 @@ msgstr "Ales asali" #: uresourcestrings.rsreloadchanged msgid "Bitmap has been modified. Do you really want to reload?" -msgstr "Tugna tettwabeddel. D tidet tebɣiḍ ad s-talseḍ asali?" +msgstr "Tugna tettwabeddel. D tidet tebɣiḍ ad s-talseḍ asali ?" #: uresourcestrings.rsremovabledrive msgid "Removable" @@ -3409,12 +3407,12 @@ msgstr "Ales tugna" #: uresourcestrings.rsresamplingimage msgid "Resampling image..." -msgstr "" +msgstr "Allus n ulemmec n tugna..." #: uresourcestrings.rsretrieveselectedarea msgctxt "uresourcestrings.rsretrieveselectedarea" msgid "Do you want to retrieve selected area?" -msgstr "Tebɣiḍ ad d-terreḍ taɣzut n tefrayt?" +msgstr "Tebɣiḍ ad d-terreḍ taɣzut n tefrayt ?" #: uresourcestrings.rsreturnvalides msgid "Press ENTER to validate" @@ -3427,7 +3425,7 @@ msgstr "RGB" #: uresourcestrings.rsrightclickforsource msgid "Use RIGHT click to define source" -msgstr "Seqdec asiti ayefus iwakken ad tesbaduḍ aɣbalu" +msgstr "Seqdec asiti ayfus iwakken ad tesbaduḍ aɣbalu" #: uresourcestrings.rssaturation msgctxt "uresourcestrings.rssaturation" @@ -3447,7 +3445,7 @@ msgstr "Sekles s yisem n ufaylu i d-ittunefken" #: uresourcestrings.rssavechanges msgctxt "uresourcestrings.rssavechanges" msgid "Current bitmap has been modified. Do you want to save changes?" -msgstr "Tugna bitmap tamirant tettwabeddel. Tebɣiḍ ad teskelseḍ ibeddien?" +msgstr "Tugna bitmap tamirant tettwabeddel. Tebɣiḍ ad teskelseḍ ibeddien ?" #: uresourcestrings.rssavepaletteas msgid "Save palette as..." @@ -3459,7 +3457,6 @@ msgid "Script" msgstr "Askript" #: uresourcestrings.rsselectblendoperation -#, fuzzy msgctxt "uresourcestrings.rsselectblendoperation" msgid "Select blend operation" msgstr "Fren tamhelt n usmezdi" @@ -3501,7 +3498,7 @@ msgstr "Ulac isem i ufaylu-agi. Seqdec \"Sekles am...\" seg wumuɣ agejdan." #: uresourcestrings.rstodo msgid "To do" -msgstr "" +msgstr "Ad ttwagen" #: uresourcestrings.rstodoimages msgid "Images left: %1" @@ -3513,15 +3510,15 @@ msgstr "Afecku ulamek ara yettwaseqdec deg tissi yeffren" #: uresourcestrings.rstoomanyactions msgid "Too many actions" -msgstr "" +msgstr "Aṭas n tigawin" #: uresourcestrings.rstoomanylayers msgid "Too many layers" -msgstr "Bezzaf n tissiyin" +msgstr "Aṭas n tissiyin" #: uresourcestrings.rstoomanyshapesinlayer msgid "Too many shapes in layer" -msgstr "Bezzaf n talɣiwin deg tissi" +msgstr "Aṭas n talɣiwin deg tissi" #: uresourcestrings.rstotalimages msgid "Total images: %1" @@ -3529,15 +3526,15 @@ msgstr "Aɣrud n tugniwin: %1" #: uresourcestrings.rstransferselectiontootherlayer msgid "Transfer selection to other layer?" -msgstr "Tebɣiḍ ad tawiḍ tafrayt ɣer tissi-nniḍen?" +msgstr "Tebɣiḍ ad tawiḍ tafrayt ɣer tissi-nniḍen ?" #: uresourcestrings.rstransformedrasterlayer msgid "Transformed raster layer" -msgstr "" +msgstr "Tissi s ipikselen tettwabeddel" #: uresourcestrings.rstransformselectioncontent msgid "Do you want to transform content of the selection?" -msgstr "Tebɣiḍ ad tselkteḍ agbur n tefrayt?" +msgstr "Tebɣiḍ ad tselkteḍ agbur n tefrayt ?" #: uresourcestrings.rsunabletoapplyfilter msgid "Unable to apply filter : " @@ -3557,7 +3554,7 @@ msgstr "Anezḍay arussin : " #: uresourcestrings.rsunknownoriginal msgid "Unknown original" -msgstr "" +msgstr "Aneṣli d arussin" #: uresourcestrings.rsvectoriallayer msgid "Vectorial layer" @@ -3568,14 +3565,11 @@ msgid "Yes" msgstr "Ih" #: uresourcestrings.rszoomlayerstackin -#, fuzzy msgctxt "uresourcestrings.rszoomlayerstackin" msgid "Zoom layer stack in" msgstr "Semɣer taɣbirt n tissiyin" #: uresourcestrings.rszoomlayerstackout -#, fuzzy msgctxt "uresourcestrings.rszoomlayerstackout" msgid "Zoom layer stack out" msgstr "Simecṭuḥ taɣbirt n tissiyin" - diff --git a/lazpaint/release/bin/i18n/lclstrconsts.kab.po b/lazpaint/release/bin/i18n/lclstrconsts.kab.po index 6b2a96cd..5dc378e3 100644 --- a/lazpaint/release/bin/i18n/lclstrconsts.kab.po +++ b/lazpaint/release/bin/i18n/lclstrconsts.kab.po @@ -1,19 +1,20 @@ msgid "" msgstr "" "Last-Translator: Yacine Bouklif \n" -"PO-Revision-Date: 2019-12-27 22:54+0100\n" -"Language-Team: Laurent Jacques \n" +"PO-Revision-Date: 2020-03-13 21:47+0100\n" +"Last-Translator: Yacine Bouklif \n" +"Language-Team: \n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "MIME-Version: 1.0\n" "POT-Creation-Date: \n" "Project-Id-Version: \n" "Language: kab\n" -"X-Generator: Poedit 2.2.4\n" +"X-Generator: Poedit 2.3\n" #: lclstrconsts.hhshelpbrowsernotexecutable msgid "Browser %s%s%s not executable." -msgstr "" +msgstr "Iminig %s%s%s ur yettwaselkam ara." #: lclstrconsts.hhshelpbrowsernotfound msgid "Browser %s%s%s not found." @@ -29,23 +30,23 @@ msgstr "D awezɣi tifin n iminig HTML." #: lclstrconsts.hhshelpnohtmlbrowserfoundpleasedefineoneinhelpconfigurehe msgid "No HTML Browser found.%sPlease define one in Environment -> Options -> Help -> Help Options" -msgstr "" +msgstr "Ulac iminig HTML yettwafen.%sTtxil-k sbadu yiwen di Tawennaḍt -> Tinefrunin -> Tallelt -> Tinefrunin n tallelt" #: lclstrconsts.hhshelpthehelpdatabasewasunabletofindfile msgid "The help database %s%s%s was unable to find file %s%s%s." -msgstr "Azadur n isefka %s%s%s ur yufi ara afaylu %s%s%s." +msgstr "Azadur n yisefka %s%s%s ur yufi ara afaylu %s%s%s." #: lclstrconsts.hhshelpthemacrosinbrowserparamswillbereplacedbytheurl msgid "The macro %s in BrowserParams will be replaced by the URL." -msgstr "" +msgstr "Amɣer %s di BrowserParams ad yettusemselsi s URL." #: lclstrconsts.ifsalt msgid "Alt" -msgstr "" +msgstr "Alt" #: lclstrconsts.ifsctrl msgid "Ctrl" -msgstr "" +msgstr "Ctrl" #: lclstrconsts.ifsvk_accept msgid "Accept" @@ -53,7 +54,7 @@ msgstr "Qbel" #: lclstrconsts.ifsvk_apps msgid "application key" -msgstr "" +msgstr "tasarut n usnas" #: lclstrconsts.ifsvk_back msgid "Backspace" @@ -62,7 +63,7 @@ msgstr "Tallunt ɣer deffir" #: lclstrconsts.ifsvk_cancel msgctxt "lclstrconsts.ifsvk_cancel" msgid "Cancel" -msgstr "" +msgstr "Sefsex" #: lclstrconsts.ifsvk_capital msgid "Capital" @@ -83,7 +84,7 @@ msgstr "Selket" #: lclstrconsts.ifsvk_delete msgctxt "lclstrconsts.ifsvk_delete" msgid "Delete" -msgstr "" +msgstr "Kkes" #: lclstrconsts.ifsvk_down msgctxt "lclstrconsts.ifsvk_down" @@ -109,7 +110,7 @@ msgstr "Aneggaru" #: lclstrconsts.ifsvk_hanja msgid "Hanja" -msgstr "" +msgstr "Hanja" #: lclstrconsts.ifsvk_help msgid "Help" @@ -123,32 +124,32 @@ msgstr "Axxam" #: lclstrconsts.ifsvk_insert msgctxt "lclstrconsts.ifsvk_insert" msgid "Insert" -msgstr "" +msgstr "Ger" #: lclstrconsts.ifsvk_junja msgid "Junja" -msgstr "" +msgstr "Junja" #: lclstrconsts.ifsvk_kana msgid "Kana" -msgstr "" +msgstr "Kana" #: lclstrconsts.ifsvk_lbutton msgid "Mouse Button Left" -msgstr "Taqfalt tazelmaḍt n tɣerdayt" +msgstr "Taqeffalt tazelmaḍt n tɣerdayt" #: lclstrconsts.ifsvk_left msgctxt "lclstrconsts.ifsvk_left" msgid "Left" -msgstr "Zelmaḍ" +msgstr "Azelmaḍ" #: lclstrconsts.ifsvk_lwin msgid "left windows key" -msgstr "" +msgstr "taqeffalt Windows tazelmaḍt" #: lclstrconsts.ifsvk_mbutton msgid "Mouse Button Middle" -msgstr "Taqfalt talemmast n tɣerdayt" +msgstr "Taqeffalt talemmast n tɣerdayt" #: lclstrconsts.ifsvk_menu msgctxt "lclstrconsts.ifsvk_menu" @@ -162,7 +163,7 @@ msgstr "Asnifel n uskar" #: lclstrconsts.ifsvk_next msgctxt "lclstrconsts.ifsvk_next" msgid "Next" -msgstr "" +msgstr "Uḍfir" #: lclstrconsts.ifsvk_nonconvert msgid "Nonconvert" @@ -170,15 +171,15 @@ msgstr "Ur ittuselket ara" #: lclstrconsts.ifsvk_numlock msgid "Numlock" -msgstr "" +msgstr "Aseḍru n imḍanen" #: lclstrconsts.ifsvk_numpad msgid "Numpad %d" -msgstr "" +msgstr "Asettif umḍin %d" #: lclstrconsts.ifsvk_pause msgid "Pause key" -msgstr "Taqfalt n usgunfu" +msgstr "Taqeffalt n usgunfu" #: lclstrconsts.ifsvk_print msgid "Print" @@ -187,11 +188,11 @@ msgstr "Siggez" #: lclstrconsts.ifsvk_prior msgctxt "lclstrconsts.ifsvk_prior" msgid "Prior" -msgstr "" +msgstr "Uzwir" #: lclstrconsts.ifsvk_rbutton msgid "Mouse Button Right" -msgstr "Taqfalt tayefust n tɣerdayt" +msgstr "Taqeffalt tayfust n tɣerdayt" #: lclstrconsts.ifsvk_return msgid "Return" @@ -200,11 +201,11 @@ msgstr "Tuɣalin" #: lclstrconsts.ifsvk_right msgctxt "lclstrconsts.ifsvk_right" msgid "Right" -msgstr "Yefus" +msgstr "Ayfus" #: lclstrconsts.ifsvk_rwin msgid "right windows key" -msgstr "" +msgstr "taqeffalt Windows tayfust" #: lclstrconsts.ifsvk_scroll msgid "Scroll" @@ -216,7 +217,7 @@ msgstr "Fren" #: lclstrconsts.ifsvk_shift msgid "Shift" -msgstr "" +msgstr "Asekḥer" #: lclstrconsts.ifsvk_snapshot msgid "Snapshot" @@ -224,12 +225,12 @@ msgstr "Tuṭṭfa n ugdil" #: lclstrconsts.ifsvk_space msgid "Space key" -msgstr "Taqfalt n tallunt" +msgstr "Taqeffalt n tallunt" #: lclstrconsts.ifsvk_tab msgctxt "lclstrconsts.ifsvk_tab" msgid "Tab" -msgstr "" +msgstr "Tabzimt" #: lclstrconsts.ifsvk_unknown msgid "Unknown" @@ -242,7 +243,7 @@ msgstr "Uksawen" #: lclstrconsts.liscannotexecute msgid "can not execute %s" -msgstr "" +msgstr "ulamek aselkem n %s" #: lclstrconsts.lislclresourcesnotfound msgctxt "lclstrconsts.lislclresourcesnotfound" @@ -251,27 +252,27 @@ msgstr "Taɣbalut %s ur tettwaf ara" #: lclstrconsts.lisprogramfilenotfound msgid "program file not found %s" -msgstr "" +msgstr "afaylu n wahil ur yettwaf ara %s" #: lclstrconsts.rs3ddkshadowcolorcaption msgid "3D Dark Shadow" -msgstr "" +msgstr "Tili timsullest 3D" #: lclstrconsts.rs3dlightcolorcaption msgid "3D Light" -msgstr "" +msgstr "Tafat 3D" #: lclstrconsts.rsacontrolcannothaveitselfasparent msgid "A control can't have itself as a parent" -msgstr "" +msgstr "Asenqed ur yezmir ara ad yesɛu iman-is d amarraw" #: lclstrconsts.rsactivebordercolorcaption msgid "Active Border" -msgstr "Iri amiran" +msgstr "Iri rmid" #: lclstrconsts.rsactivecaptioncolorcaption msgid "Active Caption" -msgstr "Tawaṭṭfa tamirant" +msgstr "Tawaṭṭfa turmidt" #: lclstrconsts.rsallfiles msgid "All files (%s)|%s|%s" @@ -279,11 +280,11 @@ msgstr "Akk ifuyla (%s)|%s|%s" #: lclstrconsts.rsappworkspacecolorcaption msgid "Application Workspace" -msgstr "" +msgstr "Tallunt n umahil n usnas" #: lclstrconsts.rsaquacolorcaption msgid "Aqua" -msgstr "" +msgstr "Anili azegzaw" #: lclstrconsts.rsbackgroundcolorcaption msgid "Desktop" @@ -295,7 +296,7 @@ msgstr "Ɣer deffir" #: lclstrconsts.rsbitmaps msgid "Bitmaps" -msgstr "" +msgstr "Bitmaps" #: lclstrconsts.rsblackcolorcaption msgid "Black" @@ -311,19 +312,19 @@ msgstr "Anili" #: lclstrconsts.rsbtnfacecolorcaption msgid "Button Face" -msgstr "" +msgstr "Udem n tqeffalt" #: lclstrconsts.rsbtnhighlightcolorcaption msgid "Button Highlight" -msgstr "" +msgstr "Asebrureq n tqeffalt" #: lclstrconsts.rsbtnshadowcolorcaption msgid "Button Shadow" -msgstr "" +msgstr "Tili n tqeffalt" #: lclstrconsts.rsbtntextcolorcaption msgid "Button Text" -msgstr "" +msgstr "Aḍris n tqeffalt" #: lclstrconsts.rscalculator msgid "Calculator" @@ -332,19 +333,19 @@ msgstr "Amsiḍen" #: lclstrconsts.rscancelrecordhint msgctxt "lclstrconsts.rscancelrecordhint" msgid "Cancel" -msgstr "" +msgstr "Sefsex" #: lclstrconsts.rscannotfocus msgid "Can not focus" -msgstr "" +msgstr "Ulamek asaḍas" #: lclstrconsts.rscanvasdoesnotallowdrawing msgid "Canvas does not allow drawing" -msgstr "Asuneɣ ɣef teɣzut n usuneɣ ur yurig ara" +msgstr "Taɣzut n usuneɣ ur tessareg ara asuneɣ" #: lclstrconsts.rscaptiontextcolorcaption msgid "Caption Text" -msgstr "" +msgstr "Aḍris n twaṭṭfa" #: lclstrconsts.rscasesensitive msgid "Case sensitive" @@ -352,27 +353,27 @@ msgstr "Yettḥulfu i tejṛut n usekkil" #: lclstrconsts.rscontrolclasscantcontainchildclass msgid "Control of class '%s' can't have control of class '%s' as a child" -msgstr "" +msgstr "Asenqed n tserkemt '%s' ulamek ara yesɛu asenqed n tserkemt '%s' d aqrur" #: lclstrconsts.rscontrolhasnoparentwindow msgid "Control '%s' has no parent window" -msgstr "" +msgstr "Asenqed '%s' ur yesɛi ara asfaylu amarraw" #: lclstrconsts.rscreamcolorcaption msgid "Cream" -msgstr "" +msgstr "Cream" #: lclstrconsts.rscreatinggdbcatchableerror msgid "Creating gdb catchable error:" -msgstr "" +msgstr "Asnulfu n tuccḍa gdb yettwaṭṭafen:" #: lclstrconsts.rscursor msgid "Cursor" -msgstr "Taḥnacaḍt" +msgstr "Taḥnaccaḍt" #: lclstrconsts.rscustomcolorcaption msgid "Custom ..." -msgstr "" +msgstr "Yugen..." #: lclstrconsts.rsdefaultcolorcaption msgid "Default" @@ -380,7 +381,7 @@ msgstr "Lexṣas" #: lclstrconsts.rsdefaultfileinfovalue msgid "permissions user group size date time" -msgstr "" +msgstr "tisirag aseqdac agraw tiddi azemz asrag" #: lclstrconsts.rsdeleterecord msgid "Delete record?" @@ -401,11 +402,11 @@ msgstr "A&karam" #: lclstrconsts.rsdocking msgid "Docking" -msgstr "" +msgstr "Asemdey" #: lclstrconsts.rsduplicateiconformat msgid "Duplicate icon format." -msgstr "" +msgstr "Sisleg amasal n tignit." #: lclstrconsts.rseditrecordhint msgid "Edit" @@ -422,7 +423,7 @@ msgstr "Tuccḍa" #: lclstrconsts.rserrorcreatingdevicecontext msgid "Error creating device context for %s.%s" -msgstr "" +msgstr "Tuccḍa deg usnulfu n twennaḍt n yibenk i %s.%s" #: lclstrconsts.rserrorinlcl msgid "ERROR in LCL: " @@ -430,7 +431,7 @@ msgstr "TUCCḌA di LCL : " #: lclstrconsts.rserroroccurredinataddressframe msgid "Error occurred in %s at %sAddress %s%s Frame %s" -msgstr "" +msgstr "Teḍra-d tuccḍa di %s di %sTansa %s%s Akatar %s" #: lclstrconsts.rserrorreadingproperty msgid "Error reading %s%s%s: %s" @@ -454,7 +455,7 @@ msgstr "Akaram \"%s\" ulac-it." #: lclstrconsts.rsfdfilealreadyexists msgid "The file \"%s\" already exists. Overwrite ?" -msgstr "Afaylu \"%s\" yella yakan. semselsi ?" +msgstr "Afaylu \"%s\" yella yakan. Ad t-tsemselsiḍ ?" #: lclstrconsts.rsfdfilemustexist msgid "File must exist" @@ -482,7 +483,7 @@ msgstr "Ldi afaylu yellan" #: lclstrconsts.rsfdoverwritefile msgid "Overwrite file ?" -msgstr "Sefsex afaylu ?" +msgstr "Semslsi afaylu ?" #: lclstrconsts.rsfdpathmustexist msgid "Path must exist" @@ -502,7 +503,7 @@ msgstr "(Afaylu \"%s\" ur yettwaf ara)" #: lclstrconsts.rsfileinformation msgid "File information" -msgstr "Isallan n ufaylu" +msgstr "Talɣut n ufaylu" #: lclstrconsts.rsfind msgid "Find" @@ -518,63 +519,63 @@ msgstr "Amezwaru" #: lclstrconsts.rsfixedcolstoobig msgid "FixedCols can't be >= ColCount" -msgstr "" +msgstr "FixedCols ur yezmir ara ad yili >= ColCount" #: lclstrconsts.rsfixedrowstoobig msgid "FixedRows can't be >= RowCount" -msgstr "" +msgstr "FixedRows ur yezmir ara ad yili >= RowCount" #: lclstrconsts.rsformcolorcaption msgid "Form" -msgstr "" +msgstr "Tiferkit" #: lclstrconsts.rsformstreamingerror msgid "Form streaming \"%s\" error: %s" -msgstr "" +msgstr "Tuccḍa n usuddem n tferkit \"%s\": %s" #: lclstrconsts.rsforward msgid "Forward" -msgstr "" +msgstr "Ɣer sdat" #: lclstrconsts.rsfuchsiacolorcaption msgid "Fuchsia" -msgstr "" +msgstr "Fuchsia" #: lclstrconsts.rsgdkoptiondebug msgid "--gdk-debug flags Turn on specific GDK trace/debug messages." -msgstr "" +msgstr "--gdk-debug flags Sermed iznan ulmisen n GDK trace/debug." #: lclstrconsts.rsgdkoptionnodebug msgid "--gdk-no-debug flags Turn off specific GDK trace/debug messages." -msgstr "" +msgstr "--gdk-no-debug flags Sens iznan ulmisen n GDK trace/debug." #: lclstrconsts.rsgif msgid "Graphics Interchange Format" -msgstr "" +msgstr "Graphics Interchange Format" #: lclstrconsts.rsgoptionfatalwarnings msgid "--g-fatal-warnings Warnings and errors generated by Gtk+/GDK will halt the application." -msgstr "" +msgstr "--g-fatal-warnings ismigalen akked tuccḍiwin i d-isarew Gtk+/GDK ad sḥebsen asnas." #: lclstrconsts.rsgradientactivecaptioncolorcaption msgid "Gradient Active Caption" -msgstr "" +msgstr "Tawaṭtfa turmidt n ufesniw" #: lclstrconsts.rsgradientinactivecaptioncolorcaption msgid "Gradient Inactive Caption" -msgstr "" +msgstr "Tawaṭtfa yensan n ufesniw" #: lclstrconsts.rsgraphic msgid "Graphic" -msgstr "" +msgstr "Udlif" #: lclstrconsts.rsgraycolorcaption msgid "Gray" -msgstr "" +msgstr "Amelliɣdi" #: lclstrconsts.rsgraytextcolorcaption msgid "Gray Text" -msgstr "" +msgstr "Aḍris amelliɣdi" #: lclstrconsts.rsgreencolorcaption msgid "Green" @@ -582,15 +583,15 @@ msgstr "Azegzaw" #: lclstrconsts.rsgridfiledoesnotexists msgid "Grid file doesn't exists" -msgstr "" +msgstr "Afaylu Grid ulac-it" #: lclstrconsts.rsgridindexoutofrange msgid "Grid index out of range." -msgstr "" +msgstr "Amatar n Grid iɛedda tilisa." #: lclstrconsts.rsgroupindexcannotbelessthanprevious msgid "GroupIndex cannot be less than a previous menu item's GroupIndex" -msgstr "" +msgstr "GroupIndex ur yezmir ara ad yili d ameẓyan ɣef GroupIndex n iferdisen uzwiren n wumuɣ" #: lclstrconsts.rsgtkfilter msgid "Filter:" @@ -602,39 +603,39 @@ msgstr "Amazray:" #: lclstrconsts.rsgtkoptionclass msgid "--class classname Following Xt conventions, the class of a program is the program name with the initial character capitalized. For example, the classname for gimp is \"Gimp\". If --class is specified, the class of the program will be set to \"classname\"." -msgstr "" +msgstr "--class classname S weḍfar n imsisiyen Xt , taserkemt n wahil d isem n wahil tesɛa asekkil amezwaru d ameqran. Deg umedya, isem n tserkemt n gimp d \"Gimp\". Ma yella --class yettunefk-d, taserkemt n wahil ad tt-ttuseɣwer ɣer \"classname\"." #: lclstrconsts.rsgtkoptiondebug msgid "--gtk-debug flags Turn on specific Gtk+ trace/debug messages." -msgstr "" +msgstr "--gtk-debug flags Sermed iznan ulmisen n Gtk+ trace/debug." #: lclstrconsts.rsgtkoptiondisplay msgid "--display h:s:d Connect to the specified X server, where \"h\" is the hostname, \"s\" is the server number (usually 0), and \"d\" is the display number (typically omitted). If --display is not specified, the DISPLAY environment variable is used." -msgstr "" +msgstr "--display h:s:d Qqen ɣer uqeddac X i d-ittunefken, anida \"h\" d isem n usneftaɣ, \"s\" d uḍḍun n uqeddac (di tegti 0), \"d\" d uḍḍun n ubeqqeḍ (yettwattu). Ma yella --display ur d-yettunefk ara, amutti awennaḍan DISPLAY ad yettwaseqdec." #: lclstrconsts.rsgtkoptionmodule msgid "--gtk-module module Load the specified module at startup." -msgstr "" +msgstr "--gtk-module module Sali-d azegrir i d-ittunefken deg usekker." #: lclstrconsts.rsgtkoptionname msgid "--name programe Set program name to \"progname\". If not specified, program name will be set to ParamStrUTF8(0)." -msgstr "" +msgstr "--name programe Seɣwer isem n wahil ɣer \"progname\". Ma yella ur d-ittunefk ara, isem n wahil ad ittuseɣwer ɣer ParamStrUTF8(0)." #: lclstrconsts.rsgtkoptionnodebug msgid "--gtk-no-debug flags Turn off specific Gtk+ trace/debug messages." -msgstr "" +msgstr "--gtk-no-debug flags Sens iznan ulmisen n Gtk+ trace/debug." #: lclstrconsts.rsgtkoptionnotransient msgid "--lcl-no-transient Do not set transient order for modal forms" -msgstr "" +msgstr "--lcl-no-transient Ur sseɣwar ara amizzwer n leɛḍil n talɣiwin tiskaranin" #: lclstrconsts.rsgtkoptionnoxshm msgid "--no-xshm Disable use of the X Shared Memory Extension." -msgstr "" +msgstr "--no-xshm Ad yesens aseqdec n tkatut yeẓlen i yebḍa X." #: lclstrconsts.rsgtkoptionsync msgid "--sync Call XSynchronize (display, True) after the Xserver connection has been established. This makes debugging X protocol errors easier, because X request buffering will be disabled and X errors will be received immediately after the protocol request that generated the error has been processed by the X server." -msgstr "" +msgstr "--sync Asiwel XSynchronize (abeqqeḍ, True) ticki teɣser tuqqna n uqeddac Xserver . Ayagi ad yesishel aseɣti n tuccḍiwin n uneggaf X, acku asuter n teɣzut n weḥraz (buffering) ad yexsi yerna tuccḍiwin X ad d-ttwaṭṭefent srid mbaɛd mi yesekker uqeddac X asuter n uneggaf i d-yurwen tuccḍa." #: lclstrconsts.rshelpalreadyregistered msgid "%s: Already registered" @@ -642,11 +643,11 @@ msgstr "%s : Yekles yakan" #: lclstrconsts.rshelpcontextnotfound msgid "Help Context not found" -msgstr "" +msgstr "Tawennaḍt n tallelt ur tettwaf ara" #: lclstrconsts.rshelpdatabasenotfound msgid "Help Database not found" -msgstr "Azadur n isefka n tallelt ur yettwaf ara" +msgstr "Azadur n yisefka n tallelt ur yettwaf ara" #: lclstrconsts.rshelperror msgid "Help Error" @@ -654,31 +655,31 @@ msgstr "Tuccḍa n tallelt" #: lclstrconsts.rshelphelpcontextnotfound msgid "Help context %s not found." -msgstr "" +msgstr "Tawennaḍt n tallelt %s ur tettwaf ara." #: lclstrconsts.rshelphelpcontextnotfoundindatabase msgid "Help context %s not found in Database %s%s%s." -msgstr "" +msgstr "Tawennaḍt n tallelt %s ur tettwaf ara deg uzadur n yisefka %s%s%s." #: lclstrconsts.rshelphelpdatabasedidnotfoundaviewerforahelppageoftype msgid "Help Database %s%s%s did not found a viewer for a help page of type %s" -msgstr "" +msgstr "Azadur n yisefka n tallelt %s%s%s ur d-yufi ara tameẓrayt i usebtar n tallelt n wanaw %s" #: lclstrconsts.rshelphelpdatabasenotfound msgid "Help Database %s%s%s not found" -msgstr "Azadur n isefka n tallelt %s%s%s ur yettwaf ara" +msgstr "Azadur n yisefka n tallelt %s%s%s ur yettwaf ara" #: lclstrconsts.rshelphelpkeywordnotfound msgid "Help keyword %s%s%s not found." -msgstr "Awal tasarut n tallelt %s%s%s ur yettwaf ara." +msgstr "Awal yufraren n tallelt %s%s%s ur yettwaf ara." #: lclstrconsts.rshelphelpkeywordnotfoundindatabase msgid "Help keyword %s%s%s not found in Database %s%s%s." -msgstr "" +msgstr "Awal yufraren n tallelt %s%s%s ur yettwaf ara deg uzadur n yisefka %s%s%s." #: lclstrconsts.rshelphelpnodehasnohelpdatabase msgid "Help node %s%s%s has no Help Database" -msgstr "Tikerrist n tallelt %s%s%s ur tesɛi ara azadur n isefka" +msgstr "Tikerrist n tallelt %s%s%s ur tesɛi ara azadur n yisefka" #: lclstrconsts.rshelpnohelpfoundforsource msgid "No help found for line %d, column %d of %s." @@ -686,7 +687,7 @@ msgstr "Ulac tallelt yettwafen i uzirig %d, ajgu %d n %s." #: lclstrconsts.rshelpnohelpnodesavailable msgid "No help nodes available" -msgstr "Ulac tikerrist n tallelt iwejden" +msgstr "Ulac tikerrisin n tallelt iwejden" #: lclstrconsts.rshelpnotfound msgid "Help not found" @@ -694,7 +695,7 @@ msgstr "Tallelt ur tettwaf ara" #: lclstrconsts.rshelpnotregistered msgid "%s: Not registered" -msgstr "%s : Ur yeklis ara" +msgstr "%s: Ur yeklis ara" #: lclstrconsts.rshelpselectorerror msgid "Help Selector Error" @@ -702,31 +703,31 @@ msgstr "Tuccḍa n umafran n tallelt" #: lclstrconsts.rshelpthereisnoviewerforhelptype msgid "There is no viewer for help type %s%s%s" -msgstr "" +msgstr "Ulac ula yiwet n tmeẓrayt i wanaw-agi n tallelt %s%s%s" #: lclstrconsts.rshelpviewererror msgid "Help Viewer Error" -msgstr "" +msgstr "Tuccḍa n tmeẓrayt n tallelt" #: lclstrconsts.rshelpviewernotfound msgid "Help Viewer not found" -msgstr "" +msgstr "Tameẓrayt n tallelt ur tettwaf ara" #: lclstrconsts.rshighlightcolorcaption msgid "Highlight" -msgstr "" +msgstr "Sebrureq" #: lclstrconsts.rshighlighttextcolorcaption msgid "Highlight Text" -msgstr "" +msgstr "Sebrureq aḍris" #: lclstrconsts.rshotlightcolorcaption msgid "Hot Light" -msgstr "" +msgstr "Tafat iǧehden" #: lclstrconsts.rsicns msgid "Mac OS X Icon" -msgstr "" +msgstr "Mac OS X Icon" #: lclstrconsts.rsicon msgid "Icon" @@ -738,7 +739,7 @@ msgstr "Tugna n tignit ulamek ara tili d tilemt" #: lclstrconsts.rsiconimageformat msgid "Icon image must have the same format" -msgstr "" +msgstr "Tugna n tignit isefk ad yili umasal-ines kif kif" #: lclstrconsts.rsiconimageformatchange msgid "Cannot change format of icon image" @@ -746,7 +747,7 @@ msgstr "D awezɣi abeddel n umasal n tugna n tignit" #: lclstrconsts.rsiconimagesize msgid "Icon image must have the same size" -msgstr "" +msgstr "Tugna n tignit isefk ad tili tiddi-ines kif kif" #: lclstrconsts.rsiconimagesizechange msgid "Cannot change size of icon image" @@ -758,33 +759,33 @@ msgstr "Tignit ur tesɛi ara tugna" #: lclstrconsts.rsinactivebordercolorcaption msgid "Inactive Border" -msgstr "" +msgstr "Iri arurmid" #: lclstrconsts.rsinactivecaptioncolorcaption msgctxt "lclstrconsts.rsinactivecaptioncolorcaption" msgid "Inactive Caption" -msgstr "" +msgstr "Tawaṭṭfa tarurmidt" #: lclstrconsts.rsinactivecaptiontext msgctxt "lclstrconsts.rsinactivecaptiontext" msgid "Inactive Caption" -msgstr "" +msgstr "Tawaṭṭfa tarurmidt" #: lclstrconsts.rsindexoutofbounds msgid "%s Index %d out of bounds 0 .. %d" -msgstr "" +msgstr "%s Amatar %d iɛedda tilisa 0 .. %d" #: lclstrconsts.rsindexoutofrange msgid "Index Out of range Cell[Col=%d Row=%d]" -msgstr "" +msgstr "Amatar iɛedda tilisa Cell[Col=%d Row=%d]" #: lclstrconsts.rsinfobkcolorcaption msgid "Info Background" -msgstr "" +msgstr "Talɣut n ugilal" #: lclstrconsts.rsinfotextcolorcaption msgid "Info Text" -msgstr "" +msgstr "Talɣut s uḍris" #: lclstrconsts.rsinsertrecordhint msgctxt "lclstrconsts.rsinsertrecordhint" @@ -797,11 +798,11 @@ msgstr "Azemz d armeɣtu : %s" #: lclstrconsts.rsinvaliddaterangehint msgid "Invalid Date: %s. Must be between %s and %s" -msgstr "" +msgstr "Azemz armeɣtu: %s. Isefk ad yili gar %s akked %s" #: lclstrconsts.rsinvalidformobjectstream msgid "invalid Form object stream" -msgstr "" +msgstr "asuddem n tɣawsa tiferkit d armeɣtu" #: lclstrconsts.rsinvalidpropertyvalue msgid "Invalid property value" @@ -817,7 +818,7 @@ msgstr "%s yeddukel yakan akked %s" #: lclstrconsts.rsjpeg msgid "Joint Picture Expert Group" -msgstr "" +msgstr "Joint Picture Expert Group" #: lclstrconsts.rslastrecordhint msgid "Last" @@ -825,11 +826,11 @@ msgstr "Aneggaru" #: lclstrconsts.rslimecolorcaption msgid "Lime" -msgstr "" +msgstr "Aqares" #: lclstrconsts.rslistindexexceedsbounds msgid "List index exceeds bounds (%d)" -msgstr "" +msgstr "Amatar n tebdart iɛedda tilisa (%d)" #: lclstrconsts.rslistmustbeempty msgid "List must be empty" @@ -845,12 +846,12 @@ msgstr "Eǧǧ" #: lclstrconsts.rsmball msgid "&All" -msgstr "A&kk" +msgstr "&Akk" #: lclstrconsts.rsmbcancel msgctxt "lclstrconsts.rsmbcancel" msgid "Cancel" -msgstr "Semmet" +msgstr "Sefsex" #: lclstrconsts.rsmbclose msgid "&Close" @@ -870,7 +871,7 @@ msgstr "&Ala" #: lclstrconsts.rsmbnotoall msgid "No to all" -msgstr "Ala i kulec" +msgstr "Ala i meṛṛa" #: lclstrconsts.rsmbok msgid "&OK" @@ -890,7 +891,7 @@ msgstr "&Sekles" #: lclstrconsts.rsmbunlock msgid "&Unlock" -msgstr "" +msgstr "&Kkes aseḍru" #: lclstrconsts.rsmbyes msgid "&Yes" @@ -898,15 +899,15 @@ msgstr "&Ih" #: lclstrconsts.rsmbyestoall msgid "Yes to &All" -msgstr "Ih i &kulec" +msgstr "Ih i &meṛṛa" #: lclstrconsts.rsmedgraycolorcaption msgid "Medium Gray" -msgstr "" +msgstr "Amelliɣdi alemmas" #: lclstrconsts.rsmenubarcolorcaption msgid "Menu Bar" -msgstr "" +msgstr "Afeggag n wumuɣ" #: lclstrconsts.rsmenucolorcaption msgctxt "lclstrconsts.rsmenucolorcaption" @@ -915,23 +916,23 @@ msgstr "Umuɣ" #: lclstrconsts.rsmenuhighlightcolorcaption msgid "Menu Highlight" -msgstr "" +msgstr "Asebrureq n wumuɣ" #: lclstrconsts.rsmenutextcolorcaption msgid "Menu Text" -msgstr "" +msgstr "Aḍris n wumuɣ" #: lclstrconsts.rsmodified msgid " modified " -msgstr "" +msgstr " yettwabeddel " #: lclstrconsts.rsmoneygreencolorcaption msgid "Money Green" -msgstr "" +msgstr "Azegzaw n wedrim" #: lclstrconsts.rsmtauthentication msgid "Authentication" -msgstr "" +msgstr "Asesteb" #: lclstrconsts.rsmtconfirmation msgid "Confirmation" @@ -952,11 +953,11 @@ msgstr "Talɣut" #: lclstrconsts.rsmtwarning msgid "Warning" -msgstr "" +msgstr "Asmigel" #: lclstrconsts.rsnavycolorcaption msgid "Navy" -msgstr "" +msgstr "Anili n yilel" #: lclstrconsts.rsnextrecordhint msgctxt "lclstrconsts.rsnextrecordhint" @@ -965,7 +966,7 @@ msgstr "Ɣer sdat" #: lclstrconsts.rsnonecolorcaption msgid "None" -msgstr "" +msgstr "Ulac" #: lclstrconsts.rsnotavalidgridfile msgid "Not a valid grid file" @@ -973,11 +974,11 @@ msgstr "Mačči d afaylu n uferrug ameɣtu" #: lclstrconsts.rsnowidgetset msgid "No widgetset object. Please check if the unit \"interfaces\" was added to the programs uses clause." -msgstr "" +msgstr "Ulac ula yiwet n tɣawsa widgetset. Ttxil-k selken ma yella aferdis \"interfaces\" yettwarna ɣer tfada n wahil." #: lclstrconsts.rsolivecolorcaption msgid "Olive" -msgstr "" +msgstr "Azemmur" #: lclstrconsts.rspickdate msgid "Select a date" @@ -985,36 +986,36 @@ msgstr "Fren azemz" #: lclstrconsts.rspixmap msgid "Pixmap" -msgstr "" +msgstr "Pixmap" #: lclstrconsts.rsportablebitmap msgid "Portable BitMap" -msgstr "" +msgstr "Portable BitMap" #: lclstrconsts.rsportablegraymap msgid "Portable GrayMap" -msgstr "" +msgstr "Portable GrayMap" #: lclstrconsts.rsportablenetworkgraphic msgid "Portable Network Graphic" -msgstr "" +msgstr "Portable Network Graphic" #: lclstrconsts.rsportablepixmap msgid "Portable PixMap" -msgstr "" +msgstr "Portable PixMap" #: lclstrconsts.rspostrecordhint msgid "Post" -msgstr "" +msgstr "Azen" #: lclstrconsts.rspressoktoignoreandriskdatacorruptionpresscanceltok msgid "%s%sPress OK to ignore and risk data corruption.%sPress Cancel to kill the program." -msgstr "" +msgstr "%s%sPress Ih iwakken ad tɛemdeḍ afsad n yisefka. %sPress Sefsex iwakken ad tmedleḍ ahil." #: lclstrconsts.rspriorrecordhint msgctxt "lclstrconsts.rspriorrecordhint" msgid "Prior" -msgstr "" +msgstr "Uzwir" #: lclstrconsts.rspropertydoesnotexist msgid "Property %s does not exist" @@ -1022,107 +1023,107 @@ msgstr "Ayla %s ulac-it" #: lclstrconsts.rspurplecolorcaption msgid "Purple" -msgstr "" +msgstr "Agadaw" #: lclstrconsts.rsqtoptiondograb msgid "-dograb (only under X11), running under a debugger can cause an implicit -nograb, use -dograb to override. Need QT_DEBUG." -msgstr "" +msgstr "-dograb (ddaw kan X11), aselkem ddaw imseɣti yezmer ad d-yeseglu s -nograb udrig, seqdec -dograb iwakken ad tsemselsiḍ. Yesra QT_DEBUG." #: lclstrconsts.rsqtoptiongraphicsstyle msgid "-graphicssystem param, sets the backend to be used for on-screen widgets and QPixmaps. Available options are native, raster and opengl. OpenGL is still unstable." -msgstr "" +msgstr "-graphicssystem param, seɣwer agilal i yiwiǧiten akked QPixmaps n wegdil. Tinefrunin iwejden d : native, raster akked opengl." #: lclstrconsts.rsqtoptionnograb msgid "-nograb, tells Qt that it must never grab the mouse or the keyboard. Need QT_DEBUG." -msgstr "" +msgstr "-nograb, ad s-yini i QT werǧin ad yeṭṭef taɣerdayt neɣ anasiw. Yesra QT_DEBUG." #: lclstrconsts.rsqtoptionreverse msgid "-reverse, sets the application's layout direction to Qt::RightToLeft." -msgstr "" +msgstr "-reverse, ad iseɣwer taɣda n tneɣruft ɣer Qt::RightToLeft." #: lclstrconsts.rsqtoptionsession msgid "-session session, restores the application from an earlier session." -msgstr "" +msgstr "-session session, ad d-yerr asnas seg tɣimit taneggarut yezrin." #: lclstrconsts.rsqtoptionstyle msgid "-style style or -style=style, sets the application GUI style. Possible values are motif, windows, and platinum. If you compiled Qt with additional styles or have additional styles as plugins these will be available to the -style command line option. NOTE: Not all styles are available on all platforms. If style param does not exist Qt will start an application with default common style (windows)." -msgstr "" +msgstr "-style style neɣ -style=style, ad iseɣwer aɣanib n usnas GUI. Azalen i yezemren ad ilin d : motif, windows, akked platinum. Ma tsefsaḍ Qt s yiɣunab imernanen neɣ tesɛiḍ iɣunab imernanen am iseɣzaf wigad-agi ad wejden i tnefrunt n unezḍay -style. Tamawt: mačči akk iɣunab i yewejden di tɣerɣerin meṛṛa. Ma ulac aɣewwar QT ad yesekker asnas s uɣanib ucrik (windows)." #: lclstrconsts.rsqtoptionstylesheet msgid "-stylesheet stylesheet or -stylesheet=stylesheet, sets the application Style Sheet. The value must be a path to a file that contains the Style Sheet. Note: Relative URLs in the Style Sheet file are relative to the Style Sheet file's path." -msgstr "" +msgstr "-stylesheet stylesheet neɣ -stylesheet=stylesheet, ad iseɣwer tiferkit n uɣanib n wesnas. Azal isefk ad yili d abrid s afaylu igebren tiferkit n uɣanib. Tamawt: URL imassɣen deg ufaylu n tferkit n uɣanib d imassaɣen ɣer ubrid n ufaylu n tferkit n uɣanib." #: lclstrconsts.rsqtoptionsync msgid "-sync (only under X11), switches to synchronous mode for debugging." -msgstr "" +msgstr "-sync (only under X11), ad isenfel askar n umtawi i weseɣti." #: lclstrconsts.rsqtoptionwidgetcount msgid "-widgetcount, prints debug message at the end about number of widgets left undestroyed and maximum number of widgets existed at the same time." -msgstr "" +msgstr "-widgetcount, ad isiggez izen n useɣti di taggara ɣef umḍan n iwiǧiten ur nettwasenger ara akked umḍan afellay n iwiǧiten i yellan deg yiwet n tikkelt." #: lclstrconsts.rsqtoptionx11bgcolor msgid "-bg or -background color, sets the default background color and an application palette (light and dark shades are calculated)." -msgstr "" +msgstr "-bg or -background color, ad yeseɣwer ini n ugilal n lexṣas akked tpaliḍt n wesnas (tili tafawt akked tili timsullest ttusektant)." #: lclstrconsts.rsqtoptionx11btncolor msgid "-btn or -button color, sets the default button color." -msgstr "" +msgstr "-btn or -button color, ad iseɣwer ini n lexṣas n tqeffalt." #: lclstrconsts.rsqtoptionx11cmap msgid "-cmap, causes the application to install a private color map on an 8-bit display." -msgstr "" +msgstr "-cmap, ad ismentel asnas iwakken ad isbedd tafelwit tamaẓlayt n yiniten deg ubeqqeḍ n 8-bit." #: lclstrconsts.rsqtoptionx11display msgid "-display display, sets the X display (default is $DISPLAY)." -msgstr "" +msgstr "-display display, ad iseɣwer abeqqeḍ X (lexṣas d $DISPLAY)." #: lclstrconsts.rsqtoptionx11fgcolor msgid "-fg or -foreground color, sets the default foreground color." -msgstr "" +msgstr "-fg or -foreground color, ad iseɣwer ini n lexṣas n ugilal." #: lclstrconsts.rsqtoptionx11font msgid "-fn or -font font, defines the application font. The font should be specified using an X logical font description." -msgstr "" +msgstr "-fn or -font font, ad isbadu tasefsit n wesnas. Tasefsit isefk ad d-ttunefk s useqdec n weglam ameẓẓul n tsefsit X." #: lclstrconsts.rsqtoptionx11geometry msgid "-geometry geometry, sets the client geometry of the first window that is shown." -msgstr "" +msgstr "-geometry geometry, ad iseɣwer tanzeggit n umsaɣ n usfaylu amezwaru ara yettwaseknen." #: lclstrconsts.rsqtoptionx11im msgid "-im, sets the input method server (equivalent to setting the XMODIFIERS environment variable)." -msgstr "" +msgstr "-im, ad iseɣwer tarrayt n usekcem n uqeddac (agdazal d aseɣwer n umutti awennaḍan XMODIFIERS )." #: lclstrconsts.rsqtoptionx11inputstyle msgid "-inputstyle, defines how the input is inserted into the given widget, e.g. onTheSpot makes the input appear directly in the widget, while overTheSpot makes the input appear in a box floating over the widget and is not inserted until the editing is done." -msgstr "" +msgstr "-inputstyle, ad yesbadu amek ara yettwager unekcum deg uwiǧit i d-ittunefken, md. onTheSpot ad yerr anekcum yettban srid deg uwiǧit, ma d onTheSpot ad yerr anekcum yettban di tenkult yettifliwen nnig n uwiǧit yerna ur yettwagar ara alama ifuk usiẓreg." #: lclstrconsts.rsqtoptionx11name msgid "-name name, sets the application name." -msgstr "" +msgstr "-name name, ad iseɣwer isem n usnas." #: lclstrconsts.rsqtoptionx11ncols msgid "-ncols count, limits the number of colors allocated in the color cube on an 8-bit display, if the application is using the QApplication::ManyColor color specification. If count is 216 then a 6x6x6 color cube is used (i.e. 6 levels of red, 6 of green, and 6 of blue); for other values, a cube approximately proportional to a 2x3x1 cube is used." -msgstr "" +msgstr "-ncols count, ad isebded amḍan n yiniten i yettwaḥeṛṛan deg ugasas n yiniten deg ubeqqeḍ n 8-bit, ma yella asnas iseqdac asefru n yini QApplication::ManyColor. Ma yella amḍan d 216 ihi agasas n yiniten 6x6x6 ad yettwaseqdec (md. 6 n yiswiren n uzeggaɣ, 6 n uzegzaw, akked 6 n unili); agasas n yiniten d amassaɣ ɣer ugasas 2x3x1 ad yettwaseqdec i wazalen-nniḍen." #: lclstrconsts.rsqtoptionx11title msgid "-title title, sets the application title." -msgstr "" +msgstr "-title title, ad iseɣwer azwel n usnas." #: lclstrconsts.rsqtoptionx11visual msgid "-visual TrueColor, forces the application to use a TrueColor visual on an 8-bit display." -msgstr "" +msgstr "-visual TrueColor, ad iḥettem asnas akken ad iseqdec TrueColor visual deg ubeqqeḍ n 8-bit." #: lclstrconsts.rsrasterimageendupdate msgid "Endupdate while no update in progress" -msgstr "" +msgstr "Endupdate ur ittleqqim ara s usfari" #: lclstrconsts.rsrasterimagesaveinupdate msgid "Cannot save image while update in progress" -msgstr "" +msgstr "Ulamek asekles n tugna ticki itteddu uleqqem" #: lclstrconsts.rsrasterimageupdateall msgid "Cannot begin update all when canvas only update in progress" -msgstr "" +msgstr "Ulamek ara yettwaleqqem ticki d taɣzut n usuneɣ kan i yetteddun" #: lclstrconsts.rsredcolorcaption msgid "Red" @@ -1130,7 +1131,7 @@ msgstr "Azeggaɣ" #: lclstrconsts.rsrefreshrecordshint msgid "Refresh" -msgstr "" +msgstr "Sismeḍ" #: lclstrconsts.rsreplace msgid "Replace" @@ -1138,7 +1139,7 @@ msgstr "Semselsi" #: lclstrconsts.rsreplaceall msgid "Replace all" -msgstr "Semselsi kulec" +msgstr "Semselsi akk" #: lclstrconsts.rsresourcenotfound msgctxt "lclstrconsts.rsresourcenotfound" @@ -1147,11 +1148,11 @@ msgstr "Taɣbalut %s ur tettwaf ara" #: lclstrconsts.rsscrollbarcolorcaption msgid "ScrollBar" -msgstr "" +msgstr "Afeggag n udrurem" #: lclstrconsts.rsscrollbaroutofrange msgid "ScrollBar property out of range" -msgstr "" +msgstr "Ayla n ufeggag n udrurem iɛedda tilisa" #: lclstrconsts.rsselectcolortitle msgid "Select color" @@ -1163,7 +1164,7 @@ msgstr "Fren tasefsit" #: lclstrconsts.rssilvercolorcaption msgid "Silver" -msgstr "" +msgstr "Aẓref" #: lclstrconsts.rssize msgid " size " @@ -1171,11 +1172,11 @@ msgstr " tiddi " #: lclstrconsts.rsskybluecolorcaption msgid "Sky Blue" -msgstr "" +msgstr "Anili n igni" #: lclstrconsts.rstealcolorcaption msgid "Teal" -msgstr "" +msgstr "Anili" #: lclstrconsts.rstext msgid "Text" @@ -1183,7 +1184,7 @@ msgstr "Aḍris" #: lclstrconsts.rstiff msgid "Tagged Image File Format" -msgstr "" +msgstr "Tagged Image File Format" #: lclstrconsts.rsunabletoloaddefaultfont msgid "Unable to load default font" @@ -1191,7 +1192,7 @@ msgstr "D awezɣi asali n tsefsit n lexṣas" #: lclstrconsts.rsunknownerrorpleasereportthisbug msgid "Unknown Error, please report this bug" -msgstr "" +msgstr "Tuccḍa tarussint, ttxil-k azen aneqqis ɣef wugur-agi" #: lclstrconsts.rsunknownpictureextension msgid "Unknown picture extension" @@ -1199,7 +1200,7 @@ msgstr "Anaw n tugna d arussin" #: lclstrconsts.rsunknownpictureformat msgid "Unknown picture format" -msgstr "" +msgstr "Amasal n tugna d arussin" #: lclstrconsts.rsunsupportedbitmapformat msgid "Unsupported bitmap format." @@ -1211,23 +1212,23 @@ msgstr "Amasal n tecfawit ur itteddu ara: %s" #: lclstrconsts.rswarningunreleaseddcsdump msgid " WARNING: There are %d unreleased DCs, a detailed dump follows:" -msgstr "" +msgstr " ALƔU: Llan %d n DCs mačči d ilelliyen, attaya telqayt:" #: lclstrconsts.rswarningunreleasedgdiobjectsdump msgid " WARNING: There are %d unreleased GDIObjects, a detailed dump follows:" -msgstr "" +msgstr " ALƔU: Llan %d n GDIObjects mačči d tilelliyin, attaya telqayt:" #: lclstrconsts.rswarningunreleasedmessagesinqueue msgid " WARNING: There are %d messages left in the queue! I'll free them" -msgstr "" +msgstr " ALƔU: Llan %d n yiznan gran deg udras ! Ad ten-slelliɣ" #: lclstrconsts.rswarningunreleasedtimerinfos msgid " WARNING: There are %d TimerInfo structures left, I'll free them" -msgstr "" +msgstr " ALƔU: Llan %d n temṣukin i yegran, ad tent-slelliɣ" #: lclstrconsts.rswarningunremovedpaintmessages msgid " WARNING: There are %s unremoved LM_PAINT/LM_GtkPAINT message links left." -msgstr "" +msgstr " ALƔU: Llan %s n isɣewnen n yiznan n LM_PAINT/LM_GtkPAINT i d-yegran ur ttwakksen ara." #: lclstrconsts.rswhitecolorcaption msgid "White" @@ -1243,7 +1244,7 @@ msgstr "Tuccḍa:" #: lclstrconsts.rswin32warning msgid "Warning:" -msgstr "" +msgstr "Asmigel:" #: lclstrconsts.rswindowcolorcaption msgid "Window" @@ -1251,11 +1252,11 @@ msgstr "Asfaylu" #: lclstrconsts.rswindowframecolorcaption msgid "Window Frame" -msgstr "" +msgstr "Akatar n usfaylu" #: lclstrconsts.rswindowtextcolorcaption msgid "Window Text" -msgstr "" +msgstr "Aḍris n usfaylu" #: lclstrconsts.rsyellowcolorcaption msgid "Yellow" @@ -1263,7 +1264,7 @@ msgstr "Awraɣ" #: lclstrconsts.scannotfocus msgid "Cannot focus a disabled or invisible window" -msgstr "" +msgstr "Ulamek asiḍes n usfaylu yensan neɣ ur nettban ara" #: lclstrconsts.sduplicatemenus msgid "Duplicate menus" @@ -1275,19 +1276,19 @@ msgstr "Asnulfu n tigawt tarmeɣtut" #: lclstrconsts.sinvalidactionenumeration msgid "Invalid action enumeration" -msgstr "" +msgstr "Tigawt n usmiwer d tarmeɣtut" #: lclstrconsts.sinvalidactionregistration msgid "Invalid action registration" -msgstr "" +msgstr "Tigawt n usekles d tarmeɣtut" #: lclstrconsts.sinvalidactionunregistration msgid "Invalid action unregistration" -msgstr "" +msgstr "Tigawt n tukksa n usekles d tarmeɣtut" #: lclstrconsts.sinvalidcharset msgid "The char set in mask \"%s\" is not valid!" -msgstr "" +msgstr "Asekkil yersen di tgelmust %s\" mačči d ameɣtu !" #: lclstrconsts.sinvalidimagesize msgid "Invalid image size" @@ -1295,35 +1296,35 @@ msgstr "Tiddi n tugna d tarmeɣtut" #: lclstrconsts.sinvalidindex msgid "Invalid ImageList Index" -msgstr "" +msgstr "Amatar n tebdart n tugniwin d armeɣtu" #: lclstrconsts.smenuindexerror msgid "Menu index out of range" -msgstr "" +msgstr "Amatar n wumuɣ iɛedda tilisa" #: lclstrconsts.smenuitemisnil msgid "MenuItem is nil" -msgstr "" +msgstr "MenuItem ur yettusdukkel ara (nil)" #: lclstrconsts.smenunotfound msgid "Sub-menu is not in menu" -msgstr "" +msgstr "Anaw anaddaw ulac-it deg wumuɣ" #: lclstrconsts.smkcalt msgid "Alt+" -msgstr "" +msgstr "Alt+" #: lclstrconsts.smkcbksp msgid "BkSp" -msgstr "" +msgstr "BkSp" #: lclstrconsts.smkcctrl msgid "Ctrl+" -msgstr "" +msgstr "Ctrl+" #: lclstrconsts.smkcdel msgid "Del" -msgstr "" +msgstr "Del" #: lclstrconsts.smkcdown msgctxt "lclstrconsts.smkcdown" @@ -1337,11 +1338,11 @@ msgstr "Taggara" #: lclstrconsts.smkcenter msgid "Enter" -msgstr "" +msgstr "Kcem" #: lclstrconsts.smkcesc msgid "Esc" -msgstr "" +msgstr "Esc" #: lclstrconsts.smkchome msgctxt "lclstrconsts.smkchome" @@ -1350,42 +1351,42 @@ msgstr "Axxam" #: lclstrconsts.smkcins msgid "Ins" -msgstr "" +msgstr "Ins" #: lclstrconsts.smkcleft msgctxt "lclstrconsts.smkcleft" msgid "Left" -msgstr "Zelmaḍ" +msgstr "Azelmaḍ" #: lclstrconsts.smkcmeta msgid "Meta+" -msgstr "" +msgstr "Meta+" #: lclstrconsts.smkcpgdn msgid "PgDn" -msgstr "" +msgstr "SbSw" #: lclstrconsts.smkcpgup msgid "PgUp" -msgstr "" +msgstr "SbKs" #: lclstrconsts.smkcright msgctxt "lclstrconsts.smkcright" msgid "Right" -msgstr "Yefus" +msgstr "Ayfus" #: lclstrconsts.smkcshift msgid "Shift+" -msgstr "" +msgstr "Shift+" #: lclstrconsts.smkcspace msgid "Space" -msgstr "" +msgstr "Tallunt" #: lclstrconsts.smkctab msgctxt "lclstrconsts.smkctab" msgid "Tab" -msgstr "" +msgstr "Tabzimt" #: lclstrconsts.smkcup msgctxt "lclstrconsts.smkcup" @@ -1394,40 +1395,40 @@ msgstr "Uksawen" #: lclstrconsts.snomdiform msgid "No MDI form present." -msgstr "" +msgstr "Ulac tiferkit MDI." #: lclstrconsts.snotimers msgid "No timers available" -msgstr "" +msgstr "Ulac imakuden iwejden" #: lclstrconsts.sparexpected msgid "Wrong token type: %s expected" -msgstr "" +msgstr "Anaw n tiddest d armeɣtu: %s yetturaǧu" #: lclstrconsts.sparinvalidfloat msgid "Invalid floating point number: %s" -msgstr "" +msgstr "Amḍan s ticcert yettifliwen d armeɣtu: %s" #: lclstrconsts.sparinvalidinteger msgid "Invalid integer number: %s" -msgstr "" +msgstr "Amḍan ummid d armeɣtu: %s" #: lclstrconsts.sparlocinfo msgid " (at %d,%d, stream offset %.8x)" -msgstr "" +msgstr " (at %d,%d, stream offset %.8x)" #: lclstrconsts.sparunterminatedbinvalue msgid "Unterminated byte value" -msgstr "" +msgstr "Azal n ubit ur nfuk ara" #: lclstrconsts.sparunterminatedstring msgid "Unterminated string" -msgstr "" +msgstr "Azrar ur nfuk ara" #: lclstrconsts.sparwrongtokensymbol msgid "Wrong token symbol: %s expected but %s found" -msgstr "" +msgstr "Azamul n tiddest d armeɣtu: yetturaǧu %s maca yettwaf %s" #: lclstrconsts.sparwrongtokentype msgid "Wrong token type: %s expected but %s found" -msgstr "" +msgstr "Anaw n tiddest d armeɣtu: yetturaǧu %s maca yettwaf %s" diff --git a/lazpaint/release/bin/i18n/lcresourcestring.kab.po b/lazpaint/release/bin/i18n/lcresourcestring.kab.po index 5a8247e1..02333867 100644 --- a/lazpaint/release/bin/i18n/lcresourcestring.kab.po +++ b/lazpaint/release/bin/i18n/lcresourcestring.kab.po @@ -1,171 +1,180 @@ -msgid "" -msgstr "Content-Type: text/plain; charset=UTF-8" - -#: lcresourcestring.rsadjusttoshape -msgid "Adjust to shape" -msgstr "" - -#: lcresourcestring.rscigsbnegative -msgid "Corr. HSL CCW" -msgstr "" - -#: lcresourcestring.rscigsbpositive -msgid "Corr. HSL CW" -msgstr "" - -#: lcresourcestring.rscilinearhslnegative -msgid "HSL CCW" -msgstr "" - -#: lcresourcestring.rscilinearhslpositive -msgid "HSL CW" -msgstr "" - -#: lcresourcestring.rscilinearrgb -msgid "RGB" -msgstr "" - -#: lcresourcestring.rscistdrgb -msgid "sRGB" -msgstr "" - -#: lcresourcestring.rscolor -msgid "Color" -msgstr "Ini" - -#: lcresourcestring.rscolorinterpolation -msgid "Color interpolation" -msgstr "" - -#: lcresourcestring.rseditgradtexpoints -msgid "Edit gradient/texture points" -msgstr "" - -#: lcresourcestring.rsendopacity -msgid "End opacity" -msgstr "" - -#: lcresourcestring.rsgradientangular -msgid "Angular" -msgstr "" - -#: lcresourcestring.rsgradientdiamond -msgid "Diamond" -msgstr "Am dyaman" - -#: lcresourcestring.rsgradientfill -msgid "Gradient fill" -msgstr "Tafesna n yini" - -#: lcresourcestring.rsgradientlinear -msgid "Linear" -msgstr "Tamziregt" - -#: lcresourcestring.rsgradientradial -msgid "Radial" -msgstr "Tazenẓarant" - -#: lcresourcestring.rsgradientreflected -msgid "Reflected" -msgstr "Ittusenddeden" - -#: lcresourcestring.rsgradientrepetition -msgid "Gradient repetition" -msgstr "" - -#: lcresourcestring.rsgrpad -msgid "Pad" -msgstr "" - -#: lcresourcestring.rsgrreflect -msgid "Reflect" -msgstr "" - -#: lcresourcestring.rsgrrepeat -msgid "Repeat" -msgstr "" - -#: lcresourcestring.rsgrsine -msgid "Sine" -msgstr "" - -#: lcresourcestring.rsincompatibletype -msgid "Incompatible type" -msgstr "" - -#: lcresourcestring.rsindexoutofbounds -msgid "Index out of bounds" -msgstr "" - -#: lcresourcestring.rslightposition -msgid "Light position" -msgstr "Ideg n tafat" - -#: lcresourcestring.rsloadtexture -msgid "Load texture" -msgstr "Sali-d tizḍi" - -#: lcresourcestring.rsnofill -msgid "No fill" -msgstr "" - -#: lcresourcestring.rsnottexturefill -msgid "It is not a texture fill" -msgstr "" - -#: lcresourcestring.rsopacity -msgid "Opacity" -msgstr "Tiḍullest" - -#: lcresourcestring.rspreview -msgid "Preview" -msgstr "Tamuɣli" - -#: lcresourcestring.rsshapeclassnotspecified -msgid "Shape class not specified" -msgstr "" - -#: lcresourcestring.rsshapenotfound -msgid "Shape not found" -msgstr "" - -#: lcresourcestring.rssolidcolor -msgid "Solid color" -msgstr "" - -#: lcresourcestring.rsstartopacity -msgid "Start opacity" -msgstr "" - -#: lcresourcestring.rsswapcolors -msgid "Swap colors" -msgstr "Senfel initen" - -#: lcresourcestring.rstexturefill -msgid "Texture fill" -msgstr "" - -#: lcresourcestring.rstexturerepetition -msgid "Texture repetition" -msgstr "" - -#: lcresourcestring.rstrnone -msgid "No repetition" -msgstr "" - -#: lcresourcestring.rstrrepeatboth -msgid "Repeat both" -msgstr "" - -#: lcresourcestring.rstrrepeatx -msgid "Repeat X" -msgstr "" - -#: lcresourcestring.rstrrepeaty -msgid "Repeat Y" -msgstr "" - -#: lcresourcestring.rsunknownshapeclass -msgid "Unknown shape class \"%1\"" -msgstr "" - +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: Yacine Bouklif \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: kab\n" +"X-Generator: Poedit 2.3\n" + +#: lcresourcestring.rsadjusttoshape +msgid "Adjust to shape" +msgstr "Sezg ɣer talɣa" + +#: lcresourcestring.rscigsbnegative +msgid "Corr. HSL CCW" +msgstr "HSL yettuseɣtin di tnila mgal tamrilt" + +#: lcresourcestring.rscigsbpositive +msgid "Corr. HSL CW" +msgstr "HSL yettuseɣtin di tnila n temrilt" + +#: lcresourcestring.rscilinearhslnegative +msgid "HSL CCW" +msgstr "HSL di tnila mgal tamrilt" + +#: lcresourcestring.rscilinearhslpositive +msgid "HSL CW" +msgstr "HSL di tnila n temrilt" + +#: lcresourcestring.rscilinearrgb +msgid "RGB" +msgstr "RGB" + +#: lcresourcestring.rscistdrgb +msgid "sRGB" +msgstr "sRGB" + +#: lcresourcestring.rscolor +msgid "Color" +msgstr "Ini" + +#: lcresourcestring.rscolorinterpolation +msgid "Color interpolation" +msgstr "Asenṭeḍ n yini" + +#: lcresourcestring.rseditgradtexpoints +msgid "Edit gradient/texture points" +msgstr "Ẓreg tinqiḍin n ufesniw/tizḍi" + +#: lcresourcestring.rsendopacity +msgid "End opacity" +msgstr "Tiḍullest n taggara" + +#: lcresourcestring.rsgradientangular +msgid "Angular" +msgstr "Uɣmir" + +#: lcresourcestring.rsgradientdiamond +msgid "Diamond" +msgstr "Am dyaman" + +#: lcresourcestring.rsgradientfill +msgid "Gradient fill" +msgstr "Taččart s ufesniw" + +#: lcresourcestring.rsgradientlinear +msgid "Linear" +msgstr "Imzireg" + +#: lcresourcestring.rsgradientradial +msgid "Radial" +msgstr "Azenẓaran" + +#: lcresourcestring.rsgradientreflected +msgid "Reflected" +msgstr "Ittusendded" + +#: lcresourcestring.rsgradientrepetition +msgid "Gradient repetition" +msgstr "Allus n ufesniw" + +#: lcresourcestring.rsgrpad +msgid "Pad" +msgstr "Aččar" + +#: lcresourcestring.rsgrreflect +msgid "Reflect" +msgstr "Sended" + +#: lcresourcestring.rsgrrepeat +msgid "Repeat" +msgstr "Ales" + +#: lcresourcestring.rsgrsine +msgid "Sine" +msgstr "Asinus" + +#: lcresourcestring.rsincompatibletype +msgid "Incompatible type" +msgstr "Anaw amyagan" + +#: lcresourcestring.rsindexoutofbounds +msgid "Index out of bounds" +msgstr "Amatar iɛedda tilisa" + +#: lcresourcestring.rslightposition +msgid "Light position" +msgstr "Ideg n tafat" + +#: lcresourcestring.rsloadtexture +msgid "Load texture" +msgstr "Sali-d tizḍi" + +#: lcresourcestring.rsnofill +msgid "No fill" +msgstr "Ulac taččart" + +#: lcresourcestring.rsnottexturefill +msgid "It is not a texture fill" +msgstr "Mačči d taččart s tizḍi" + +#: lcresourcestring.rsopacity +msgid "Opacity" +msgstr "Tiḍullest" + +#: lcresourcestring.rspreview +msgid "Preview" +msgstr "Tadlayt" + +#: lcresourcestring.rsshapeclassnotspecified +msgid "Shape class not specified" +msgstr "Taserkemt n talɣa ur d-ttunefk ara" + +#: lcresourcestring.rsshapenotfound +msgid "Shape not found" +msgstr "Talɣa ur tettwaf ara" + +#: lcresourcestring.rssolidcolor +msgid "Solid color" +msgstr "Ini amsari" + +#: lcresourcestring.rsstartopacity +msgid "Start opacity" +msgstr "Tiḍullest n tazwara" + +#: lcresourcestring.rsswapcolors +msgid "Swap colors" +msgstr "Semmeskel initen" + +#: lcresourcestring.rstexturefill +msgid "Texture fill" +msgstr "Taččart s tizḍi" + +#: lcresourcestring.rstexturerepetition +msgid "Texture repetition" +msgstr "Allus n tizḍi" + +#: lcresourcestring.rstrnone +msgid "No repetition" +msgstr "Ulac allus" + +#: lcresourcestring.rstrrepeatboth +msgid "Repeat both" +msgstr "Ales di sin" + +#: lcresourcestring.rstrrepeatx +msgid "Repeat X" +msgstr "Ales X" + +#: lcresourcestring.rstrrepeaty +msgid "Repeat Y" +msgstr "Ales Y" + +#: lcresourcestring.rsunknownshapeclass +msgid "Unknown shape class \"%1\"" +msgstr "Taserkemt n talɣa tarussint \"%1\"" From e92b8ecf681f0985114193b93e9c3b810fc08733 Mon Sep 17 00:00:00 2001 From: johann Date: Sun, 15 Mar 2020 10:17:20 +0100 Subject: [PATCH 29/53] complete Bulgarian translation --- lazpaint/release/bin/i18n/lazpaint.bg.po | 499 ++++++++---------- .../release/bin/i18n/lcresourcestring.bg.po | 351 ++++++------ 2 files changed, 393 insertions(+), 457 deletions(-) diff --git a/lazpaint/release/bin/i18n/lazpaint.bg.po b/lazpaint/release/bin/i18n/lazpaint.bg.po index 7929b12e..a1f39341 100644 --- a/lazpaint/release/bin/i18n/lazpaint.bg.po +++ b/lazpaint/release/bin/i18n/lazpaint.bg.po @@ -1,4 +1,4 @@ -msgid "" +msgid "" msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Project-Id-Version: LazPaint\n" @@ -9,7 +9,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Transfer-Encoding: 8bit\n" "Language: bg\n" -"X-Generator: Poedit 2.2.3\n" +"X-Generator: Poedit 2.2.4\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: tablet.getprocfailed @@ -21,7 +21,6 @@ msgid "Tablet context failed to open." msgstr "" #: tfabout.button_donate.caption -#, fuzzy msgctxt "tfabout.button_donate.caption" msgid "Donate..." msgstr "Дарение..." @@ -41,11 +40,9 @@ msgid "Authors:" msgstr "Автори:" #: tfabout.label_authorsvalue.caption -#, fuzzy -#| msgid "Circular help by FabienWang and Lainz" msgctxt "TFABOUT.LABEL_AUTHORSVALUE.CAPTION" msgid "Circular helped by FabienWang, Lainz and others" -msgstr "Circular, с помощта на FabienWang и Lainz" +msgstr "Circular, с помощта на FabienWang, Lainz и други" #: tfabout.label_homepage.caption msgctxt "TFABOUT.LABEL_HOMEPAGE.CAPTION" @@ -68,24 +65,22 @@ msgid "Open source (GPLv3)" msgstr "Отворен код (GPLv3)" #: tfadjustcurves.button_cancel.caption -#, fuzzy msgctxt "tfadjustcurves.button_cancel.caption" msgid "Cancel" msgstr "Отказ" #: tfadjustcurves.button_ok.caption -#, fuzzy msgctxt "tfadjustcurves.button_ok.caption" msgid "OK" msgstr "Добре" #: tfadjustcurves.caption msgid "Adjust curves" -msgstr "" +msgstr "Настройка на кривите" #: tfadjustcurves.toolbutton_newcurve.hint msgid "Discard current curve and start a new one" -msgstr "" +msgstr "Изоставяне на текущата крива и започване на нова" #: tfadjustcurves.toolbutton_posterize.hint msgctxt "tfadjustcurves.toolbutton_posterize.hint" @@ -94,7 +89,7 @@ msgstr "" #: tfadjustcurves.toolbutton_removepoint.hint msgid "Remove selected point (Del)" -msgstr "" +msgstr "Изтриване на избраната точка" #: tfblendop.button_cancel.caption msgctxt "TFBLENDOP.BUTTON_CANCEL.CAPTION" @@ -112,12 +107,12 @@ msgstr "Смесване" #: tfblendop.label_blendopcategory.caption msgid "Category of blend operation" -msgstr "" +msgstr "Категория на смесването" #: tfblendop.label_blendopvalue.caption msgctxt "tfblendop.label_blendopvalue.caption" msgid "." -msgstr "" +msgstr "." #: tfblendop.label_kritaover.caption msgctxt "TFBLENDOP.LABEL_KRITAOVER.CAPTION" @@ -135,50 +130,50 @@ msgstr "Друго" #: tfblendop.label_otherover.hint msgid "Blend operations of LazPaint and Paint.NET" -msgstr "" +msgstr "Смесвания на LazPaint и Paint.NET" #: tfblendop.label_patternover.caption msgctxt "TFBLENDOP.LABEL_PATTERNOVER.CAPTION" msgid "Pattern over" -msgstr "" +msgstr "Шарка отгоре" #: tfblendop.label_patternover.hint msgid "Preview blend operation with the specified image on top" -msgstr "" +msgstr "Преглед на смесването с указаното изображение отгоре" #: tfblendop.label_patternunder.caption msgctxt "TFBLENDOP.LABEL_PATTERNUNDER.CAPTION" msgid "Pattern under" -msgstr "" +msgstr "Шарка отдолу" #: tfblendop.label_patternunder.hint msgid "Preview blend operation with the specified image underneath" -msgstr "" +msgstr "Преглед на смесването с указаното изображение отдолу" #: tfblendop.label_previewwith.caption msgid "Preview with" -msgstr "" +msgstr "Преглед с" #: tfblendop.label_selectedblendop.caption msgid "Selected blend operation :" -msgstr "" +msgstr "Избрано смесване: " #: tfblendop.label_svgover.caption msgctxt "TFBLENDOP.LABEL_SVGOVER.CAPTION" msgid "Basic SVG" -msgstr "" +msgstr "Основен SVG" #: tfblendop.label_svgover.hint msgid "Basic blend operations that are available in virtually all image editors" -msgstr "" +msgstr "Основни смесвания, които са налични в почти всички образообработчици" #: tfbrowseimages.caption msgid "Browse images" -msgstr "" +msgstr "Обзор за изображения" #: tfbrowseimages.checkbox_usedirectoryonstartup.caption msgid "Use this directory on startup" -msgstr "" +msgstr "Използване на тази папка при пускане на приложението" #: tfbrowseimages.label_status.caption #, fuzzy @@ -188,27 +183,27 @@ msgstr "." #: tfbrowseimages.toolbutton_createfolderorcontainer.hint msgid "Create folder or container" -msgstr "" +msgstr "Създаване на папка или съдържател" #: tfbrowseimages.toolbutton_goup.hint msgid "Go one directory up" -msgstr "" +msgstr "Отиване папка нагоре" #: tfbrowseimages.toolbutton_openselectedfiles.hint msgid "Open selected files" -msgstr "" +msgstr "Отваряне на избраните файлове" #: tfbrowseimages.toolbutton_viewbigicon.hint msgid "Show big icons" -msgstr "" +msgstr "Показване на големи значета" #: tfbrowseimages.toolbutton_viewdetails.hint msgid "Show details and preview" -msgstr "" +msgstr "Показване на подробности и преглед" #: tfbrowseimages.tool_selectdrive.hint msgid "Select drive" -msgstr "" +msgstr "Избиране на устройство" #: tfcanvassize.button_cancel.caption msgctxt "TFCANVASSIZE.BUTTON_CANCEL.CAPTION" @@ -227,7 +222,7 @@ msgstr "Размер на платното" #: tfcanvassize.checkbox_flipmode.caption msgid "Flip mode" -msgstr "" +msgstr "Режим на обръщане" #: tfcanvassize.label_anchor.caption msgctxt "TFCANVASSIZE.LABEL_ANCHOR.CAPTION" @@ -259,7 +254,7 @@ msgstr "Цвят" #: tfchoosecolor.lcolor.hint msgid "Color description: click to type in a color with the keyboard using color names or CSS notation." -msgstr "" +msgstr "Описание на цвета: цъкнете, за да напишете цвят по име или по CSS означение" #: tfcolorintensity.button_cancel.caption msgctxt "TFCOLORINTENSITY.BUTTON_CANCEL.CAPTION" @@ -318,7 +313,7 @@ msgstr "Отенък" #: tfcolorize.label_preset.caption msgid "Preset" -msgstr "" +msgstr "Предварително зададени" #: tfcustomblur.button_cancel.caption msgctxt "TFCUSTOMBLUR.BUTTON_CANCEL.CAPTION" @@ -364,11 +359,11 @@ msgstr "Вкопаване" #: tfemboss.checkbox_preservecolors.caption msgid "Preserve colors" -msgstr "" +msgstr "Запазване на цветовете" #: tfemboss.checkbox_transparent.caption msgid "Transparent" -msgstr "" +msgstr "Прозрачно" #: tfemboss.label_direction.caption msgctxt "TFEMBOSS.LABEL_DIRECTION.CAPTION" @@ -391,7 +386,7 @@ msgstr "Прилагане на функцията" #: tffilterfunction.checkbox_gamma.caption msgid "Gamma correction" -msgstr "" +msgstr "Поправка на гамата" #: tffilterfunction.checkbox_gsba.caption msgctxt "TFFILTERFUNCTION.CHECKBOX_GSBA.CAPTION" @@ -399,53 +394,39 @@ msgid "Corrected hue and lightness" msgstr "Поправени отенък и яркост" #: tffilterfunction.label_alphaequals.caption -#, fuzzy -#| msgid "Alpha =" msgctxt "tffilterfunction.label_alphaequals.caption" msgid "." -msgstr "Алфа =" +msgstr "." #: tffilterfunction.label_blueequals.caption -#, fuzzy -#| msgid "Blue =" msgctxt "tffilterfunction.label_blueequals.caption" msgid "." -msgstr "Синьо =" +msgstr "." #: tffilterfunction.label_greenequals.caption -#, fuzzy -#| msgid "Green =" msgctxt "tffilterfunction.label_greenequals.caption" msgid "." -msgstr "Зелено =" +msgstr "." #: tffilterfunction.label_hueequals.caption -#, fuzzy -#| msgid "Hue =" msgctxt "tffilterfunction.label_hueequals.caption" msgid "." -msgstr "Отенък =" +msgstr "." #: tffilterfunction.label_lightnessequals.caption -#, fuzzy -#| msgid "Lightness =" msgctxt "tffilterfunction.label_lightnessequals.caption" msgid "." -msgstr "Осветеност =" +msgstr "." #: tffilterfunction.label_redequals.caption -#, fuzzy -#| msgid "Red =" msgctxt "tffilterfunction.label_redequals.caption" msgid "." -msgstr "Червено =" +msgstr "." #: tffilterfunction.label_saturationequals.caption -#, fuzzy -#| msgid "Saturation =" msgctxt "tffilterfunction.label_saturationequals.caption" msgid "." -msgstr "Насищане =" +msgstr "." #: tffilterfunction.label_variables.caption msgid "Variables :" @@ -461,28 +442,26 @@ msgid "RGB" msgstr "ЧЗС" #: tfgeometricbrush.button_cancel.caption -#, fuzzy msgctxt "tfgeometricbrush.button_cancel.caption" msgid "Cancel" msgstr "Отказ" #: tfgeometricbrush.button_ok.caption -#, fuzzy msgctxt "tfgeometricbrush.button_ok.caption" msgid "OK" msgstr "Добре" #: tfgeometricbrush.caption msgid "Geometric brush" -msgstr "" +msgstr "Геометрична четка" #: tfgeometricbrush.checkbox_isgradient.caption msgid "Opacity gradient" -msgstr "" +msgstr "Преливане на непрозрачността" #: tfgeometricbrush.label1.caption msgid "Number of sides:" -msgstr "" +msgstr "Брой страни:" #: tfimagelist.caption msgid "Image List" @@ -604,17 +583,17 @@ msgstr "Слоеве" #: tflayerstack.toolblendop.hint msgctxt "tflayerstack.toolblendop.hint" msgid "Select blend operation" -msgstr "" +msgstr "Изберете смесване" #: tflayerstack.toolzoomlayerstackin.hint msgctxt "tflayerstack.toolzoomlayerstackin.hint" msgid "Zoom layer stack in" -msgstr "" +msgstr "Увеличаване на купа със слоеве" #: tflayerstack.toolzoomlayerstackout.hint msgctxt "tflayerstack.toolzoomlayerstackout.hint" msgid "Zoom layer stack out" -msgstr "" +msgstr "Смаляване на купа със слоеве" #: tfloading.caption msgctxt "tfloading.caption" @@ -623,15 +602,15 @@ msgstr "Зареждане..." #: tfmain.brushcreategeometric.hint msgid "Create geometric brush" -msgstr "" +msgstr "Създаване на геометрична четка" #: tfmain.brushloadfromfile.hint msgid "Load brush from file..." -msgstr "" +msgstr "Зареждане на четка от файл..." #: tfmain.brushremovecurrent.hint msgid "Remove current brush" -msgstr "" +msgstr "Премахване на текущата четка" #: tfmain.caption msgctxt "TFMAIN.CAPTION" @@ -640,7 +619,7 @@ msgstr "ЛазПейнт" #: tfmain.colorcolorize.caption msgid "Colorize..." -msgstr "" +msgstr "Добавяне на цвят..." #: tfmain.colorcurves.caption msgid "Curves..." @@ -655,10 +634,8 @@ msgid "Intensity..." msgstr "Наситеност..." #: tfmain.colorlightness.caption -#, fuzzy -#| msgid "Lightness..." msgid "Brightness / Contrast..." -msgstr "Осветеност..." +msgstr "Яркост/ Контраст..." #: tfmain.colorposterize.caption msgid "Posterize..." @@ -671,7 +648,7 @@ msgstr "Цветово разместване..." #: tfmain.combobox_penstyle.hint msgid "Pen style" -msgstr "" +msgstr "Вид на чертата" #: tfmain.editcopy.caption msgid "Copy" @@ -748,7 +725,6 @@ msgid "Select all" msgstr "Избиране на всичко" #: tfmain.editselectall.hint -#, fuzzy msgctxt "tfmain.editselectall.hint" msgid "Select all" msgstr "Избиране на всичко" @@ -816,19 +792,19 @@ msgstr "Одобряване на измененията" #: tfmain.exportpicturedialog.title msgid "Export as..." -msgstr "" +msgstr "Изнасяне като..." #: tfmain.filechooseentry.caption msgid "Choose entry..." -msgstr "" +msgstr "Избиране на предмет..." #: tfmain.filechooseentry.hint msgid "Choose entry within file" -msgstr "" +msgstr "Избиране на предмет от файл" #: tfmain.fileexport.caption msgid "Export..." -msgstr "" +msgstr "Изнасяне..." #: tfmain.fileimport3d.caption msgid "Import 3D object..." @@ -875,7 +851,7 @@ msgstr "Запомняне на формата за съхраняване" #: tfmain.filerunscript.caption msgid "Run script..." -msgstr "" +msgstr "Изпълняване на скрипт..." #: tfmain.filesave.caption msgctxt "TFMAIN.FILESAVE.CAPTION" @@ -943,11 +919,9 @@ msgid "Precise blur..." msgstr "Точно размиване..." #: tfmain.filterblurradial.caption -#, fuzzy -#| msgid "Radial blur..." msgctxt "TFMAIN.FILTERBLURRADIAL.CAPTION" msgid "Gaussian blur..." -msgstr "Звездобразно размиване..." +msgstr "Гаусово размиване..." #: tfmain.filtercleartype.caption msgid "ClearType" @@ -959,7 +933,7 @@ msgstr "" #: tfmain.filtercomplementarycolor.caption msgid "Complementary colors" -msgstr "" +msgstr "Допълнителни цветове" #: tfmain.filtercontour.caption msgid "Contour" @@ -984,7 +958,7 @@ msgstr "Сиво- бяло" #: tfmain.filterlinearnegative.caption msgctxt "TFMAIN.FILTERLINEARNEGATIVE.CAPTION" msgid "Linear negative" -msgstr "" +msgstr "Линеен негатив" #: tfmain.filtermedian.caption msgid "Median" @@ -997,7 +971,7 @@ msgstr "Негатив" #: tfmain.filternoise.caption msgid "Noise filter..." -msgstr "" +msgstr "Шумов филтър..." #: tfmain.filternormalize.caption msgid "Normalize" @@ -1014,7 +988,7 @@ msgstr "" #: tfmain.filterplane.caption msgid "Plane (slow)" -msgstr "" +msgstr "Равнинно (бавно)" #: tfmain.filterrain.caption msgid "Rain..." @@ -1094,10 +1068,9 @@ msgstr "Водоравно обръщане на изборажението" #: tfmain.imagelinearnegative.caption msgctxt "tfmain.imagelinearnegative.caption" msgid "Linear negative" -msgstr "" +msgstr "Линеен негатив" #: tfmain.imagenegative.caption -#, fuzzy msgctxt "tfmain.imagenegative.caption" msgid "Negative" msgstr "Негатив" @@ -1128,7 +1101,7 @@ msgstr "Умно увеличаване х 3" #: tfmain.imageswapredblue.caption msgid "Swap red and blue channels" -msgstr "" +msgstr "Размяна на червения и синия канал" #: tfmain.imageverticalflip.caption msgctxt "tfmain.imageverticalflip.caption" @@ -1163,7 +1136,6 @@ msgid "Fullscreen" msgstr "Цял екран" #: tfmain.itemuseimagebrowser.caption -#, fuzzy msgctxt "tfmain.itemuseimagebrowser.caption" msgid "Use image browser" msgstr "Използване на обзорник за изображенията" @@ -1178,7 +1150,7 @@ msgstr "Височина" #: tfmain.label_back.caption msgid "Back" -msgstr "Назад" +msgstr "Подцв." #: tfmain.label_brush.caption msgctxt "TFMAIN.LABEL_BRUSH.CAPTION" @@ -1186,10 +1158,8 @@ msgid "Brush" msgstr "Четка" #: tfmain.label_coordinates.caption -#, fuzzy -#| msgid "99999x99999" msgid "9999x9999" -msgstr "99999x99999" +msgstr "9999x9999" #: tfmain.label_coordinates.hint msgid "Coordinates" @@ -1255,7 +1225,7 @@ msgstr "Обрамчване" #: tfmain.label_ratio.caption msgid "Ratio" -msgstr "" +msgstr "Съотношение" #: tfmain.label_shadowoffset.caption msgctxt "TFMAIN.LABEL_SHADOWOFFSET.CAPTION" @@ -1269,7 +1239,7 @@ msgstr "Форма" #: tfmain.label_spacing.caption msgid "Spacing" -msgstr "" +msgstr "Разредка" #: tfmain.label_text.caption msgctxt "TFMAIN.LABEL_TEXT.CAPTION" @@ -1294,7 +1264,7 @@ msgstr "Добавяне на нов слой" #: tfmain.layerduplicate.hint msgctxt "tfmain.layerduplicate.hint" msgid "Duplicate selected layer" -msgstr "" +msgstr "Повтаряне на избрания слой" #: tfmain.layerfromfile.hint msgctxt "TFMAIN.LAYERFROMFILE.HINT" @@ -1308,7 +1278,7 @@ msgstr "Водоравно обръщане на слоя" #: tfmain.layermergeover.hint msgctxt "TFMAIN.LAYERMERGEOVER.HINT" msgid "Merge layer over" -msgstr "" +msgstr "Сливане с долните слоеве" #: tfmain.layermove.hint msgctxt "TFMAIN.LAYERMOVE.HINT" @@ -1317,7 +1287,7 @@ msgstr "Преместване на слоя" #: tfmain.layerrasterize.hint msgid "Rasterize layer" -msgstr "" +msgstr "Преобразуване към решетъчен слой" #: tfmain.layerremovecurrent.hint msgctxt "TFMAIN.LAYERREMOVECURRENT.HINT" @@ -1336,7 +1306,7 @@ msgstr "Отвесно обръщане на слоя" #: tfmain.layerzoom.hint msgid "Zoom layer" -msgstr "" +msgstr "Увеличаване на слоя" #: tfmain.loadselectiondialog.title msgid "Load selection" @@ -1349,19 +1319,19 @@ msgstr "Цветове" #: tfmain.menucoordinatestoolbar.caption msgid "Show coordinates" -msgstr "" +msgstr "Показване на координати" #: tfmain.menucopypastetoolbar.caption msgid "Show copy/paste toolbar" -msgstr "" +msgstr "Показване на лента за запомняне/ поставяне" #: tfmain.menudocktoolboxleft.caption msgid "Dock left" -msgstr "" +msgstr "Загнездване отляво" #: tfmain.menudocktoolboxright.caption msgid "Dock right" -msgstr "" +msgstr "Загнездване отдясно" #: tfmain.menuedit.caption msgctxt "TFMAIN.MENUEDIT.CAPTION" @@ -1374,7 +1344,7 @@ msgstr "Файл" #: tfmain.menufiletoolbar.caption msgid "Show file toolbar" -msgstr "" +msgstr "Показване на файлова лента" #: tfmain.menufilter.caption msgctxt "TFMAIN.MENUFILTER.CAPTION" @@ -1392,7 +1362,6 @@ msgid "Image" msgstr "Изображение" #: tfmain.menulanguage.caption -#, fuzzy msgctxt "tfmain.menulanguage.caption" msgid "Language" msgstr "Език/ Language" @@ -1420,7 +1389,7 @@ msgstr "Измазване" #: tfmain.menuscript.caption msgctxt "tfmain.menuscript.caption" msgid "Script" -msgstr "" +msgstr "Скрипт" #: tfmain.menuselect.caption msgctxt "TFMAIN.MENUSELECT.CAPTION" @@ -1433,19 +1402,17 @@ msgid "Show palette" msgstr "Показване на палитрата" #: tfmain.menutool.caption -#, fuzzy -#| msgid "Tool" msgctxt "TFMAIN.MENUTOOL.CAPTION" msgid "Tools" -msgstr "Пособие" +msgstr "Пособия" #: tfmain.menuundocktoolbox.caption msgid "Undock" -msgstr "" +msgstr "Отгнездване" #: tfmain.menuundoredotoolbar.caption msgid "Show undo/redo toolbar" -msgstr "" +msgstr "Показване на лента за отмяна/връщане" #: tfmain.menuview.caption msgctxt "TFMAIN.MENUVIEW.CAPTION" @@ -1454,7 +1421,7 @@ msgstr "Изглед" #: tfmain.menuzoomtoolbar.caption msgid "Show zoom toolbar" -msgstr "" +msgstr "Показване на лента за увеличаване" #: tfmain.open3dobjectdialog.title msgctxt "TFMAIN.OPEN3DOBJECTDIALOG.TITLE" @@ -1463,14 +1430,12 @@ msgstr "Внасяне на тримерен предмет" #: tfmain.openbrushdialog.title msgid "Open brush" -msgstr "" +msgstr "Отваряне на четка" #: tfmain.openpicturedialog1.title -#, fuzzy -#| msgid "Open existing file" msgctxt "TFMAIN.OPENPICTUREDIALOG1.TITLE" msgid "Open existing image" -msgstr "Отварянето на съществуващ файл" +msgstr "Отварянето на съществуващо изображение" #: tfmain.opentexturedialog.title msgctxt "tfmain.opentexturedialog.title" @@ -1485,7 +1450,7 @@ msgstr "Повтаряне на изображението" #: tfmain.perspective_twoplanes.hint msgctxt "TFMAIN.PERSPECTIVE_TWOPLANES.HINT" msgid "Draw opposite plane too" -msgstr "" +msgstr "Изчертаване и на противоположна равнина" #: tfmain.rendercamouflage.caption msgid "Camouflage" @@ -1564,15 +1529,15 @@ msgstr "Отвесно обръщане на избраното" #: tfmain.spinedit_arrowsizex.hint msgid "Horizontal size of the arrow" -msgstr "" +msgstr "Водоравен размер на стрелката" #: tfmain.spinedit_arrowsizey.hint msgid "Vertical size of the arrow" -msgstr "" +msgstr "Отвесен размер на стрелката" #: tfmain.spinedit_brushspacing.hint msgid "Spacing between patterns" -msgstr "" +msgstr "Разстояние между шарките" #: tfmain.spinedit_eraser.hint msgctxt "TFMAIN.SPINEDIT_ERASER.HINT" @@ -1592,7 +1557,7 @@ msgstr "Дебелина на рамката" #: tfmain.spinedit_shapealtitude.hint msgctxt "TFMAIN.SPINEDIT_SHAPEALTITUDE.HINT" msgid "Shape altitude" -msgstr "" +msgstr "Височина на формата" #: tfmain.spinedit_textblur.hint msgctxt "TFMAIN.SPINEDIT_TEXTBLUR.HINT" @@ -1616,17 +1581,16 @@ msgstr "Отвесно отместване на сянката" #: tfmain.spinedit_textsize.hint msgid "Text size" -msgstr "" +msgstr "Размер на текста" #: tfmain.toolbrush.hint -#, fuzzy msgctxt "tfmain.toolbrush.hint" msgid "Brush" msgstr "Четка" #: tfmain.toolchangedocking.hint msgid "Change docking" -msgstr "" +msgstr "Промяна на загнездването" #: tfmain.toolclone.hint msgid "Clone tool" @@ -1639,11 +1603,11 @@ msgstr "Цветомер" #: tfmain.tooldeformation.caption msgid "Deformation" -msgstr "Изкривяване" +msgstr "Разкривяване" #: tfmain.tooldeformation.hint msgid "Deformation grid" -msgstr "Решетка за изкривяване" +msgstr "Решетка за разкривяване" #: tfmain.tooleditshape.hint msgid "Edit shape" @@ -1682,11 +1646,11 @@ msgstr "Преместване и превъртане на изображени #: tfmain.toolhotspot.caption msgctxt "tfmain.toolhotspot.caption" msgid "Hot spot" -msgstr "" +msgstr "Гореща област" #: tfmain.toolhotspot.hint msgid "Choose hot spot of a cursor" -msgstr "" +msgstr "Избиране на гореща област на показалец" #: tfmain.toollayermapping.hint msgctxt "TFMAIN.TOOLLAYERMAPPING.HINT" @@ -1708,7 +1672,7 @@ msgstr "Преместване на избраното" #: tfmain.toolopenedcurve.hint msgid "Opened curve" -msgstr "" +msgstr "Отворена крива" #: tfmain.toolpen.caption msgctxt "TFMAIN.TOOLPEN.CAPTION" @@ -1730,11 +1694,11 @@ msgstr "Многоъгълник" #: tfmain.toolpolygon.hint msgid "Polygon or polyline" -msgstr "Многоъсълник или многостранник" +msgstr "Многоъгълник или многостранник" #: tfmain.toolpolyline.hint msgid "Polyline" -msgstr "" +msgstr "Множествена линия" #: tfmain.toolrect.hint msgctxt "TFMAIN.TOOLRECT.HINT" @@ -1782,11 +1746,9 @@ msgid "Curve" msgstr "Крива" #: tfmain.toolspline.hint -#, fuzzy -#| msgid "Spline" msgctxt "TFMAIN.TOOLSPLINE.HINT" msgid "Curve" -msgstr "Сплайн (кривка)" +msgstr "Крива" #: tfmain.tooltext.hint msgctxt "TFMAIN.TOOLTEXT.HINT" @@ -1805,63 +1767,63 @@ msgstr "" #: tfmain.tool_capflat.hint msgctxt "TFMAIN.TOOL_CAPFLAT.HINT" msgid "Flat cap" -msgstr "" +msgstr "Плосък край" #: tfmain.tool_capround.hint msgctxt "TFMAIN.TOOL_CAPROUND.HINT" msgid "Round cap" -msgstr "" +msgstr "Закръглен край" #: tfmain.tool_capsquare.hint msgctxt "TFMAIN.TOOL_CAPSQUARE.HINT" msgid "Square cap" -msgstr "" +msgstr "Правоъгълен край" #: tfmain.tool_closeshape.hint msgctxt "TFMAIN.TOOL_CLOSESHAPE.HINT" msgid "Close shape" -msgstr "" +msgstr "Избиране на форма" #: tfmain.tool_curvemodeangle.hint msgid "Draw an angle" -msgstr "" +msgstr "Чертане на ъгъл" #: tfmain.tool_curvemodeauto.hint msgid "Autodetect angles" -msgstr "" +msgstr "Самооткриване на ъглите" #: tfmain.tool_curvemodecurve.hint msgid "Draw a curve" -msgstr "" +msgstr "Чертане на крива" #: tfmain.tool_curvemovepoint.hint msgid "Move point" -msgstr "" +msgstr "Преместване на точката" #: tfmain.tool_drawshapeborder.hint msgctxt "TFMAIN.TOOL_DRAWSHAPEBORDER.HINT" msgid "Draw border" -msgstr "" +msgstr "Обрамчване" #: tfmain.tool_erasealpha.hint msgid "Make transparent" -msgstr "" +msgstr "Да се направи прозрачно" #: tfmain.tool_eraseblur.hint msgid "Soften" -msgstr "" +msgstr "Смекчаване" #: tfmain.tool_erasedarken.hint msgid "Darken" -msgstr "" +msgstr "Затъмняване" #: tfmain.tool_eraselighten.hint msgid "Lighten" -msgstr "" +msgstr "Осветяване" #: tfmain.tool_erasesharpen.hint msgid "Sharpen" -msgstr "" +msgstr "Изостряне" #: tfmain.tool_fillshape.hint msgctxt "TFMAIN.TOOL_FILLSHAPE.HINT" @@ -1871,7 +1833,7 @@ msgstr "Запълване на формата" #: tfmain.tool_gridmovewithoutdeformation.hint msgctxt "TFMAIN.TOOL_GRIDMOVEWITHOUTDEFORMATION.HINT" msgid "Move grid without deformation" -msgstr "" +msgstr "Местене на решетката без разкривяване" #: tfmain.tool_joinbevel.hint msgctxt "TFMAIN.TOOL_JOINBEVEL.HINT" @@ -1896,7 +1858,7 @@ msgstr "Конус" #: tfmain.tool_phongshapehorizontalcylinder.hint msgctxt "TFMAIN.TOOL_PHONGSHAPEHORIZONTALCYLINDER.HINT" msgid "Horizontal cylinder" -msgstr "" +msgstr "Водоравен цилиндър" #: tfmain.tool_phongshaperectangle.hint msgctxt "TFMAIN.TOOL_PHONGSHAPERECTANGLE.HINT" @@ -1939,11 +1901,11 @@ msgstr "" #: tfmain.tool_textalignleft.hint msgid "Align left" -msgstr "" +msgstr "Подравняване вляво" #: tfmain.tool_textalignright.hint msgid "Align right" -msgstr "" +msgstr "Подравняване вдясно" #: tfmain.tool_textfont.hint msgctxt "TFMAIN.TOOL_TEXTFONT.HINT" @@ -1953,7 +1915,7 @@ msgstr "Избор на шрифт..." #: tfmain.tool_textoutline.hint msgctxt "TFMAIN.TOOL_TEXTOUTLINE.HINT" msgid "Text outline" -msgstr "" +msgstr "Обрамчване на текста" #: tfmain.tool_textphong.hint msgctxt "TFMAIN.TOOL_TEXTPHONG.HINT" @@ -2061,28 +2023,26 @@ msgstr "" #: tfmotionblur.checkbox_oriented.caption msgid "Oriented" -msgstr "" +msgstr "Насочено" #: tfmotionblur.label_distance.caption msgctxt "TFMOTIONBLUR.LABEL_DISTANCE.CAPTION" msgid "Distance :" -msgstr "" +msgstr "Разстояние:" #: tfmultiimage.button_cancel.caption -#, fuzzy msgctxt "tfmultiimage.button_cancel.caption" msgid "Cancel" msgstr "Отказ" #: tfmultiimage.button_ok.caption -#, fuzzy msgctxt "tfmultiimage.button_ok.caption" msgid "OK" msgstr "Добре" #: tfmultiimage.caption msgid "Choose image" -msgstr "" +msgstr "Избиране на изображение" #: tfnewimage.button_cancel.caption msgctxt "TFNEWIMAGE.BUTTON_CANCEL.CAPTION" @@ -2101,7 +2061,7 @@ msgstr "Ново изображение" #: tfnewimage.combobox_bitdepth.text msgid "32" -msgstr "" +msgstr "32" #: tfnewimage.label_bitdepth.caption msgid "Bit depth :" @@ -2114,11 +2074,11 @@ msgstr "Височина:" #: tfnewimage.label_height1.caption msgid "Ratio :" -msgstr "" +msgstr "Съотношение:" #: tfnewimage.label_memoryrequired.caption msgid "Memory required :" -msgstr "" +msgstr "Необходима памет: " #: tfnewimage.label_width.caption msgctxt "TFNEWIMAGE.LABEL_WIDTH.CAPTION" @@ -2126,32 +2086,30 @@ msgid "Width :" msgstr "Ширина:" #: tfnoisefilter.button_cancel.caption -#, fuzzy msgctxt "tfnoisefilter.button_cancel.caption" msgid "Cancel" msgstr "Отказ" #: tfnoisefilter.button_ok.caption -#, fuzzy msgctxt "tfnoisefilter.button_ok.caption" msgid "OK" msgstr "Добре" #: tfnoisefilter.caption msgid "Noise filter" -msgstr "" +msgstr "Шумов филтър" #: tfnoisefilter.label_opacity.caption msgid "Opacity:" -msgstr "" +msgstr "Непрозрачност:" #: tfnoisefilter.radio_grayscalenoise.caption msgid "Grayscale noise" -msgstr "" +msgstr "Сив шум" #: tfnoisefilter.radio_rgbnoise.caption msgid "RGB noise" -msgstr "" +msgstr "ЧЗС шум" #: tfobject3d.button_cancel.caption msgctxt "TFOBJECT3D.BUTTON_CANCEL.CAPTION" @@ -2173,7 +2131,7 @@ msgstr "Добре" #: tfobject3d.caption msgid "3D object" -msgstr "" +msgstr "3М предмет" #: tfobject3d.checkbox_antialiasing.caption msgid "Antialiasing" @@ -2202,7 +2160,6 @@ msgid "Color :" msgstr "Цвят:" #: tfobject3d.label_color1.caption -#, fuzzy msgctxt "tfobject3d.label_color1.caption" msgid "Color :" msgstr "Цвят:" @@ -2219,7 +2176,7 @@ msgstr "" #: tfobject3d.label_lights.caption msgid "Lights :" -msgstr "" +msgstr "Светлини:" #: tfobject3d.label_materials.caption msgctxt "TFOBJECT3D.LABEL_MATERIALS.CAPTION" @@ -2248,7 +2205,7 @@ msgstr "Увеличаване" #: tfobject3d.lights.caption msgid "Lights" -msgstr "" +msgstr "Светлини" #: tfobject3d.materials.caption msgid "Materials" @@ -2380,13 +2337,11 @@ msgid "Quality :" msgstr "Качество:" #: tfposterize.button_cancel.caption -#, fuzzy msgctxt "tfposterize.button_cancel.caption" msgid "Cancel" msgstr "Отказ" #: tfposterize.button_ok.caption -#, fuzzy msgctxt "tfposterize.button_ok.caption" msgid "OK" msgstr "Добре" @@ -2402,11 +2357,11 @@ msgstr "" #: tfposterize.label_levels.caption msgid "Levels :" -msgstr "" +msgstr "Равнища:" #: tfpreviewdialog.caption msgid "Preview" -msgstr "" +msgstr "Преглед" #: tfpreviewdialog.lstatus.caption #, fuzzy @@ -2423,7 +2378,6 @@ msgid "Print!" msgstr "Разпечатване!" #: tfprint.button_zoomfit.caption -#, fuzzy msgctxt "tfprint.button_zoomfit.caption" msgid "Zoom fit" msgstr "Вместващо увеличаване" @@ -2433,7 +2387,6 @@ msgid "Print" msgstr "Разпечатване" #: tfprint.checkbox_ratio.caption -#, fuzzy msgctxt "tfprint.checkbox_ratio.caption" msgid "Keep aspect ratio" msgstr "Запазване на съотношението" @@ -2512,7 +2465,6 @@ msgid "OK" msgstr "Добре" #: tfradialblur.caption -#, fuzzy msgctxt "TFRADIALBLUR.CAPTION" msgid "Radial blur" msgstr "Лъчево размиване" @@ -2523,28 +2475,26 @@ msgid "Radius :" msgstr "Радиус:" #: tfrain.button_cancel.caption -#, fuzzy msgctxt "tfrain.button_cancel.caption" msgid "Cancel" msgstr "Отказ" #: tfrain.button_ok.caption -#, fuzzy msgctxt "tfrain.button_ok.caption" msgid "OK" msgstr "Добре" #: tfrain.caption msgid "Rain" -msgstr "" +msgstr "Дъжд" #: tfrain.label_quantity.caption msgid "Quantity:" -msgstr "" +msgstr "Количество:" #: tfrain.label_wind.caption msgid "Wind :" -msgstr "" +msgstr "Вятър:" #: tfresample.button_cancel.caption msgctxt "TFRESAMPLE.BUTTON_CANCEL.CAPTION" @@ -2582,19 +2532,16 @@ msgid "Width :" msgstr "Ширина:" #: tfsaveoption.button_cancel.caption -#, fuzzy msgctxt "tfsaveoption.button_cancel.caption" msgid "Cancel" msgstr "Отказ" #: tfsaveoption.button_ok.caption -#, fuzzy msgctxt "tfsaveoption.button_ok.caption" msgid "OK" msgstr "Добре" #: tfsaveoption.caption -#, fuzzy msgctxt "tfsaveoption.caption" msgid "Save" msgstr "Съхраняване" @@ -2663,12 +2610,12 @@ msgstr "Добре" #: tfsharpen.caption msgid "Sharpen/Smooth" -msgstr "" +msgstr "Изостряне/ Изглаждане" #: tfsharpen.label_amount.caption msgctxt "TFSHARPEN.LABEL_AMOUNT.CAPTION" msgid "Amount :" -msgstr "" +msgstr "Количество: " #: tfshiftcolors.button_cancel.caption msgctxt "TFSHIFTCOLORS.BUTTON_CANCEL.CAPTION" @@ -2686,7 +2633,6 @@ msgid "Shift colors" msgstr "Изместване на цветовете" #: tfshiftcolors.checkbox_gsba.caption -#, fuzzy msgctxt "tfshiftcolors.checkbox_gsba.caption" msgid "Corrected hue and lightness" msgstr "Поправени отенък и осветеност" @@ -2732,13 +2678,11 @@ msgid "Radius :" msgstr "Радиус:" #: tfwavedisplacement.button_cancel.caption -#, fuzzy msgctxt "tfwavedisplacement.button_cancel.caption" msgid "Cancel" msgstr "Отказ" #: tfwavedisplacement.button_ok.caption -#, fuzzy msgctxt "tfwavedisplacement.button_ok.caption" msgid "OK" msgstr "Добре" @@ -2757,7 +2701,7 @@ msgstr "" #: tfwavedisplacement.label_wavelength.caption msgid "Wavelength :" -msgstr "" +msgstr "Вълнова дължина:" #: uresourcestrings.rsactioninprogress msgid "Action in progress" @@ -2777,11 +2721,11 @@ msgstr "всички" #: uresourcestrings.rsallsupportedfiletypes msgid "All supported filetypes" -msgstr "" +msgstr "Всички поддържани файлове" #: uresourcestrings.rsalt msgid "ALT" -msgstr "" +msgstr "ALT" #: uresourcestrings.rsanimatedgif msgid "Animated GIF" @@ -2809,25 +2753,24 @@ msgstr "" #: uresourcestrings.rsblue msgid "Blue" -msgstr "" +msgstr "Синьо" #: uresourcestrings.rsbrightness msgid "Brightness" -msgstr "" +msgstr "Яркост" #: uresourcestrings.rsbytes msgid "Bytes" -msgstr "" +msgstr "Байта" #: uresourcestrings.rscancel -#, fuzzy msgctxt "uresourcestrings.rscancel" msgid "Cancel" msgstr "Отказ" #: uresourcestrings.rscancelledbyuser msgid "Cancelled by user" -msgstr "" +msgstr "Отказано от потребителя" #: uresourcestrings.rscannotdrawshapeonsvglayer msgid "Cannot draw shape on SVG layer" @@ -2835,7 +2778,7 @@ msgstr "" #: uresourcestrings.rscannotopenfile msgid "Cannot open file" -msgstr "" +msgstr "Грешка при отваряне на файла" #: uresourcestrings.rscanvassize msgctxt "uresourcestrings.rscanvassize" @@ -2865,15 +2808,15 @@ msgstr "Цветове" #: uresourcestrings.rsconfirmdeletefromcontainer msgid "Are you sure you want to delete this file from the container?" -msgstr "" +msgstr "Наистина ли искате да изтриете файла от съдържателя?" #: uresourcestrings.rsconfirmdeletemultiplefromcontainer msgid "Are you sure you want to delete these %1 files from the container?" -msgstr "" +msgstr "Наистина ли искате да изтриете тези %1 файла от съдържателя?" #: uresourcestrings.rsconfirmmovemultipletotrash msgid "Are you sure you want to move these %1 files to the trash?" -msgstr "" +msgstr "Наистина ли искате да преместите тези %1 файла в кошчето?" #: uresourcestrings.rsconfirmmovetotrash msgid "Are you sure you want to move this file to the trash?" @@ -2885,7 +2828,7 @@ msgstr "" #: uresourcestrings.rscontrast msgid "Contrast" -msgstr "" +msgstr "Контраст" #: uresourcestrings.rscorrectedhueccw msgid "Corr. Hue CCW" @@ -2905,7 +2848,7 @@ msgstr "Орязване" #: uresourcestrings.rsctrl msgid "CTRL" -msgstr "" +msgstr "CTRL" #: uresourcestrings.rscurvemodehint msgid "Press S or X to set the curve mode of the last point" @@ -2913,10 +2856,9 @@ msgstr "" #: uresourcestrings.rsdefaultpalette msgid "Default palette" -msgstr "" +msgstr "Подразбирана палитра" #: uresourcestrings.rsdeletefile -#, fuzzy msgctxt "uresourcestrings.rsdeletefile" msgid "Delete" msgstr "Изтриване" @@ -2927,7 +2869,7 @@ msgstr "" #: uresourcestrings.rsdirectorynotempty msgid "Directory is not empty" -msgstr "" +msgstr "Папката не е празна" #: uresourcestrings.rsditherlayerusingpalette msgid "Dither layer using palette" @@ -2975,7 +2917,7 @@ msgstr "" #: uresourcestrings.rserror msgid "Error" -msgstr "" +msgstr "Грешка" #: uresourcestrings.rserrordecodingraw msgid "Error decoding raw image." @@ -3011,15 +2953,15 @@ msgstr "очаква N ключа : " #: uresourcestrings.rsfast msgid "Fast" -msgstr "" +msgstr "Бързо" #: uresourcestrings.rsfilecannotbeempty msgid "File cannot be empty" -msgstr "" +msgstr "Файлът не може да е празен" #: uresourcestrings.rsfiledate msgid "Date" -msgstr "" +msgstr "Дата" #: uresourcestrings.rsfileextensionnotsupported msgid "This file extension is not supported." @@ -3035,23 +2977,23 @@ msgstr "Файлово име" #: uresourcestrings.rsfilenotfound msgid "File not found!" -msgstr "" +msgstr "Файлът не е намерен!" #: uresourcestrings.rsfilenotsaved msgid "File not saved" -msgstr "" +msgstr "Файлът не е съхранен" #: uresourcestrings.rsfilesize msgid "Size" -msgstr "" +msgstr "Размер" #: uresourcestrings.rsfilesystem msgid "File system" -msgstr "" +msgstr "Файлова уредба" #: uresourcestrings.rsfiletype msgid "Type" -msgstr "" +msgstr "Вид" #: uresourcestrings.rsfixeddrive msgid "Fixed" @@ -3059,7 +3001,7 @@ msgstr "" #: uresourcestrings.rsfolder msgid "Folder" -msgstr "" +msgstr "Папка" #: uresourcestrings.rsfolderorcontaineralreadyexists msgid "Folder or container already exists." @@ -3079,7 +3021,7 @@ msgstr "" #: uresourcestrings.rsgreen msgid "Green" -msgstr "" +msgstr "Зелено" #: uresourcestrings.rshalfcosine msgid "Half-cosine" @@ -3104,10 +3046,9 @@ msgstr "" #: uresourcestrings.rshotspot msgctxt "uresourcestrings.rshotspot" msgid "Hot spot" -msgstr "" +msgstr "Гореща област" #: uresourcestrings.rshue -#, fuzzy msgctxt "uresourcestrings.rshue" msgid "Hue" msgstr "Отенък" @@ -3139,18 +3080,13 @@ msgstr "Изображението е твърде голямо" #: uresourcestrings.rsinfinity msgid "Infinity" -msgstr "" +msgstr "Безкрайност" #: uresourcestrings.rsinformation msgid "Information" msgstr "" -#: uresourcestrings.rsdownload -msgid "Download" -msgstr "Изтегли" - #: uresourcestrings.rsintensity -#, fuzzy msgctxt "uresourcestrings.rsintensity" msgid "Intensity" msgstr "Наситеност" @@ -3161,7 +3097,7 @@ msgstr "Вътрешна грешка" #: uresourcestrings.rsinvalidname msgid "Invalid name" -msgstr "" +msgstr "Недопустимо име" #: uresourcestrings.rsinvalidopacity msgid "Invalid opacity : " @@ -3204,13 +3140,11 @@ msgid "Layered image" msgstr "" #: uresourcestrings.rslayers -#, fuzzy msgctxt "uresourcestrings.rslayers" msgid "Layers" msgstr "Слоеве" #: uresourcestrings.rslazpaint -#, fuzzy msgctxt "uresourcestrings.rslazpaint" msgid "LazPaint" msgstr "ЛазПейнт" @@ -3224,22 +3158,21 @@ msgid "Light" msgstr "Светлина" #: uresourcestrings.rslightness -#, fuzzy msgctxt "uresourcestrings.rslightness" msgid "Lightness" msgstr "Осветеност" #: uresourcestrings.rslightposition msgid "Light position" -msgstr "" +msgstr "Разположение на светлината" #: uresourcestrings.rslinear msgid "Linear" -msgstr "" +msgstr "Линейно" #: uresourcestrings.rslinearrgb msgid "Linear RGB" -msgstr "" +msgstr "Линейно ЧЗС" #: uresourcestrings.rsloadandmergepalette msgid "Load and merge palette..." @@ -3251,11 +3184,11 @@ msgstr "Зареждане" #: uresourcestrings.rsloadpalette msgid "Load palette..." -msgstr "" +msgstr "Зареждане на палитра..." #: uresourcestrings.rsloopcount msgid "Loop count" -msgstr "" +msgstr "Брой повторения" #: uresourcestrings.rsmakencolorspalettefrombitmap msgid "Make %1-colors palette from image" @@ -3287,7 +3220,7 @@ msgstr "" #: uresourcestrings.rsnetworkdrive msgid "Network" -msgstr "" +msgstr "Мрежа" #: uresourcestrings.rsnewimage msgctxt "uresourcestrings.rsnewimage" @@ -3296,7 +3229,7 @@ msgstr "Ново изображение" #: uresourcestrings.rsno msgid "No" -msgstr "" +msgstr "Не" #: uresourcestrings.rsnoactivelayer msgid "No active layer" @@ -3308,7 +3241,7 @@ msgstr "Няма нищо избрано" #: uresourcestrings.rsnoandproceedtonext msgid "Do not save and open another file" -msgstr "" +msgstr "Да не се съхранява и да се отвори друг файл" #: uresourcestrings.rsnoname msgid "noname" @@ -3320,7 +3253,7 @@ msgstr "Обикновен" #: uresourcestrings.rsnothingtobedeformed msgid "There is nothing to be deformed" -msgstr "" +msgstr "Няма нищо за разкривяване" #: uresourcestrings.rsnothingtoberetrieved msgid "There is nothing to be retrieved" @@ -3332,11 +3265,11 @@ msgstr "" #: uresourcestrings.rsnumber msgid "№" -msgstr "" +msgstr "№" #: uresourcestrings.rsokay msgid "Okay" -msgstr "" +msgstr "Добре" #: uresourcestrings.rsopacity msgid "Opacity" @@ -3368,7 +3301,7 @@ msgstr "Друго..." #: uresourcestrings.rsoverwritefile msgid "File already exists. Do you want to overwrite it?" -msgstr "" +msgstr "Файлът вече съществува. Да бъде ли заменен?" #: uresourcestrings.rspaletteincludesalphachannel msgid "Palette includes alpha channel" @@ -3376,10 +3309,9 @@ msgstr "" #: uresourcestrings.rspaletteoptions msgid "Palette options" -msgstr "" +msgstr "Възможности на палитрата" #: uresourcestrings.rspercent -#, fuzzy msgctxt "uresourcestrings.rspercent" msgid "%" msgstr "%" @@ -3394,31 +3326,31 @@ msgstr "" #: uresourcestrings.rspresetname msgid "Preset name" -msgstr "" +msgstr "Предварително зададено име" #: uresourcestrings.rspx msgid "px" -msgstr "" +msgstr "точки" #: uresourcestrings.rspythonunexpectedversion -msgid "Expected Python version %1 but %2 found." -msgstr "" +msgid "Expected python version %1 but %2 found." +msgstr "Нужен е Python v. %1, но имате v. %2." #: uresourcestrings.rsramdisk msgid "RAM disk" -msgstr "" +msgstr "RAM диск" #: uresourcestrings.rsrasterlayer msgid "Raster layer" -msgstr "" +msgstr "Решетъчен слой" #: uresourcestrings.rsrecentdirectories msgid "Recent directories:" -msgstr "" +msgstr "Скорошни папки" #: uresourcestrings.rsred msgid "Red" -msgstr "" +msgstr "Червено" #: uresourcestrings.rsreload msgctxt "uresourcestrings.rsreload" @@ -3431,7 +3363,7 @@ msgstr "Изображението е променено. Наистина ли #: uresourcestrings.rsremovabledrive msgid "Removable" -msgstr "" +msgstr "Премахваем" #: uresourcestrings.rsrepeatimage msgctxt "uresourcestrings.rsrepeatimage" @@ -3440,7 +3372,7 @@ msgstr "Повтаряне на изображението" #: uresourcestrings.rsresamplingimage msgid "Resampling image..." -msgstr "" +msgstr "Преоразмеряване на изображението..." #: uresourcestrings.rsretrieveselectedarea msgid "Do you want to retrieve selected area?" @@ -3451,17 +3383,15 @@ msgid "Press ENTER to validate" msgstr "Натиснете Enter, за да одобрите" #: uresourcestrings.rsrgb -#, fuzzy msgctxt "uresourcestrings.rsrgb" msgid "RGB" msgstr "ЧЗС" #: uresourcestrings.rsrightclickforsource msgid "Use RIGHT click to define source" -msgstr "" +msgstr "Укажете източника с ДЕСЕН цък" #: uresourcestrings.rssaturation -#, fuzzy msgctxt "uresourcestrings.rssaturation" msgid "Saturation" msgstr "Насищане" @@ -3473,7 +3403,7 @@ msgstr "Съхраняване" #: uresourcestrings.rssaveasbuttonhint msgid "Save with specified filename" -msgstr "" +msgstr "Съхраняване под указаното име" #: uresourcestrings.rssavechanges msgid "Current bitmap has been modified. Do you want to save changes?" @@ -3481,41 +3411,39 @@ msgstr "Изображението е променено. Искате ли да #: uresourcestrings.rssavepaletteas msgid "Save palette as..." -msgstr "" +msgstr "Съхраняване на палитрата като..." #: uresourcestrings.rsscript msgctxt "uresourcestrings.rsscript" msgid "Script" -msgstr "" +msgstr "Скрипт" #: uresourcestrings.rsselectblendoperation msgctxt "uresourcestrings.rsselectblendoperation" msgid "Select blend operation" -msgstr "" +msgstr "Избор на смесване" #: uresourcestrings.rsshift msgid "SHIFT" -msgstr "" +msgstr "SHIFT" #: uresourcestrings.rsshowpalette -#, fuzzy msgctxt "uresourcestrings.rsshowpalette" msgid "Show palette" msgstr "Показване на палитрата" #: uresourcestrings.rssourceposition msgid "Source position" -msgstr "" +msgstr "Местоположение на източника" #: uresourcestrings.rsspline -#, fuzzy msgctxt "uresourcestrings.rsspline" msgid "Spline" msgstr "Сплайн (кривка)" #: uresourcestrings.rsstoragedevice msgid "Device" -msgstr "" +msgstr "Устройство" #: uresourcestrings.rstexturemapping msgctxt "uresourcestrings.rstexturemapping" @@ -3524,11 +3452,11 @@ msgstr "" #: uresourcestrings.rstherearenocheckeditems msgid "There are no checked items. Check some items or add some new ones." -msgstr "" +msgstr "Няма отметнати предмети. Отметнете някои или добавете нови." #: uresourcestrings.rsthereisnofilenamegivenforthisfileusesaveas msgid "There is no file name given for this file. Use \"Save as...\" from the main menu." -msgstr "" +msgstr "Няма указано име за този файл. Използвайте „Съхраняване като...“ от главния изборник." #: uresourcestrings.rstodo msgid "To do" @@ -3540,19 +3468,19 @@ msgstr "Оставащи изображения: %1" #: uresourcestrings.rstooloninvisiblelayer msgid "Tool cannot be used on an invisible layer" -msgstr "" +msgstr "Пособието не е приложимо за невидим слой" #: uresourcestrings.rstoomanyactions msgid "Too many actions" -msgstr "" +msgstr "Твърде много действия" #: uresourcestrings.rstoomanylayers msgid "Too many layers" -msgstr "" +msgstr "Твърде много слоеве" #: uresourcestrings.rstoomanyshapesinlayer msgid "Too many shapes in layer" -msgstr "" +msgstr "Твърде много форми в слоя" #: uresourcestrings.rstotalimages msgid "Total images: %1" @@ -3560,7 +3488,7 @@ msgstr "Общо изображения: %1" #: uresourcestrings.rstransferselectiontootherlayer msgid "Transfer selection to other layer?" -msgstr "" +msgstr "Прехвърляне на избраното в друг слой?" #: uresourcestrings.rstransformedrasterlayer msgid "Transformed raster layer" @@ -3568,43 +3496,42 @@ msgstr "" #: uresourcestrings.rstransformselectioncontent msgid "Do you want to transform content of the selection?" -msgstr "" +msgstr "Искате ли да преобразувате съдържанието на избора?" #: uresourcestrings.rsunabletoapplyfilter msgid "Unable to apply filter : " -msgstr "" +msgstr "Неуспешно прилагане на филтъра:" #: uresourcestrings.rsunabletoloadfile msgid "Unable to load file : " -msgstr "" +msgstr "Неуспешно зареждане на файл:" #: uresourcestrings.rsunabletosavefile msgid "Unable to save file : " -msgstr "" +msgstr "Неуспешно съхраняване на файл:" #: uresourcestrings.rsunknowncommand msgid "Unknown command : " -msgstr "" +msgstr "Неизвестна заповед:" #: uresourcestrings.rsunknownoriginal msgid "Unknown original" -msgstr "" +msgstr "Неизвестен произход" #: uresourcestrings.rsvectoriallayer msgid "Vectorial layer" -msgstr "" +msgstr "Векторен слой" #: uresourcestrings.rsyes msgid "Yes" -msgstr "" +msgstr "Да" #: uresourcestrings.rszoomlayerstackin msgctxt "uresourcestrings.rszoomlayerstackin" msgid "Zoom layer stack in" -msgstr "" +msgstr "Увеличаване на купа" #: uresourcestrings.rszoomlayerstackout msgctxt "uresourcestrings.rszoomlayerstackout" msgid "Zoom layer stack out" -msgstr "" - +msgstr "Отдалечаване на купа" diff --git a/lazpaint/release/bin/i18n/lcresourcestring.bg.po b/lazpaint/release/bin/i18n/lcresourcestring.bg.po index 140cb9df..d2d2848a 100644 --- a/lazpaint/release/bin/i18n/lcresourcestring.bg.po +++ b/lazpaint/release/bin/i18n/lcresourcestring.bg.po @@ -1,171 +1,180 @@ -msgid "" -msgstr "Content-Type: text/plain; charset=UTF-8" - -#: lcresourcestring.rsadjusttoshape -msgid "Adjust to shape" -msgstr "" - -#: lcresourcestring.rscigsbnegative -msgid "Corr. HSL CCW" -msgstr "" - -#: lcresourcestring.rscigsbpositive -msgid "Corr. HSL CW" -msgstr "" - -#: lcresourcestring.rscilinearhslnegative -msgid "HSL CCW" -msgstr "" - -#: lcresourcestring.rscilinearhslpositive -msgid "HSL CW" -msgstr "" - -#: lcresourcestring.rscilinearrgb -msgid "RGB" -msgstr "" - -#: lcresourcestring.rscistdrgb -msgid "sRGB" -msgstr "" - -#: lcresourcestring.rscolor -msgid "Color" -msgstr "Цвят" - -#: lcresourcestring.rscolorinterpolation -msgid "Color interpolation" -msgstr "" - -#: lcresourcestring.rseditgradtexpoints -msgid "Edit gradient/texture points" -msgstr "" - -#: lcresourcestring.rsendopacity -msgid "End opacity" -msgstr "" - -#: lcresourcestring.rsgradientangular -msgid "Angular" -msgstr "" - -#: lcresourcestring.rsgradientdiamond -msgid "Diamond" -msgstr "" - -#: lcresourcestring.rsgradientfill -msgid "Gradient fill" -msgstr "Преливане" - -#: lcresourcestring.rsgradientlinear -msgid "Linear" -msgstr "Линейно" - -#: lcresourcestring.rsgradientradial -msgid "Radial" -msgstr "Лъчево" - -#: lcresourcestring.rsgradientreflected -msgid "Reflected" -msgstr "Отражателно" - -#: lcresourcestring.rsgradientrepetition -msgid "Gradient repetition" -msgstr "" - -#: lcresourcestring.rsgrpad -msgid "Pad" -msgstr "" - -#: lcresourcestring.rsgrreflect -msgid "Reflect" -msgstr "" - -#: lcresourcestring.rsgrrepeat -msgid "Repeat" -msgstr "" - -#: lcresourcestring.rsgrsine -msgid "Sine" -msgstr "Синусоидално" - -#: lcresourcestring.rsincompatibletype -msgid "Incompatible type" -msgstr "" - -#: lcresourcestring.rsindexoutofbounds -msgid "Index out of bounds" -msgstr "" - -#: lcresourcestring.rslightposition -msgid "Light position" -msgstr "Разположение на светлината" - -#: lcresourcestring.rsloadtexture -msgid "Load texture" -msgstr "" - -#: lcresourcestring.rsnofill -msgid "No fill" -msgstr "" - -#: lcresourcestring.rsnottexturefill -msgid "It is not a texture fill" -msgstr "" - -#: lcresourcestring.rsopacity -msgid "Opacity" -msgstr "Прозрачност" - -#: lcresourcestring.rspreview -msgid "Preview" -msgstr "" - -#: lcresourcestring.rsshapeclassnotspecified -msgid "Shape class not specified" -msgstr "" - -#: lcresourcestring.rsshapenotfound -msgid "Shape not found" -msgstr "" - -#: lcresourcestring.rssolidcolor -msgid "Solid color" -msgstr "" - -#: lcresourcestring.rsstartopacity -msgid "Start opacity" -msgstr "" - -#: lcresourcestring.rsswapcolors -msgid "Swap colors" -msgstr "Превключване на цвета" - -#: lcresourcestring.rstexturefill -msgid "Texture fill" -msgstr "" - -#: lcresourcestring.rstexturerepetition -msgid "Texture repetition" -msgstr "" - -#: lcresourcestring.rstrnone -msgid "No repetition" -msgstr "" - -#: lcresourcestring.rstrrepeatboth -msgid "Repeat both" -msgstr "" - -#: lcresourcestring.rstrrepeatx -msgid "Repeat X" -msgstr "" - -#: lcresourcestring.rstrrepeaty -msgid "Repeat Y" -msgstr "" - -#: lcresourcestring.rsunknownshapeclass -msgid "Unknown shape class \"%1\"" -msgstr "" - +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: bg\n" +"X-Generator: Poedit 2.2.3\n" + +#: lcresourcestring.rsadjusttoshape +msgid "Adjust to shape" +msgstr "Нагласяне според формата" + +#: lcresourcestring.rscigsbnegative +msgid "Corr. HSL CCW" +msgstr "Попр. НОО ОЧС" + +#: lcresourcestring.rscigsbpositive +msgid "Corr. HSL CW" +msgstr "Попр. НОО ЧС" + +#: lcresourcestring.rscilinearhslnegative +msgid "HSL CCW" +msgstr "НОО ОЧС" + +#: lcresourcestring.rscilinearhslpositive +msgid "HSL CW" +msgstr "НОО ЧС" + +#: lcresourcestring.rscilinearrgb +msgid "RGB" +msgstr "ЧЗС" + +#: lcresourcestring.rscistdrgb +msgid "sRGB" +msgstr "" + +#: lcresourcestring.rscolor +msgid "Color" +msgstr "Цвят" + +#: lcresourcestring.rscolorinterpolation +msgid "Color interpolation" +msgstr "" + +#: lcresourcestring.rseditgradtexpoints +msgid "Edit gradient/texture points" +msgstr "" + +#: lcresourcestring.rsendopacity +msgid "End opacity" +msgstr "Крайна прозрачност" + +#: lcresourcestring.rsgradientangular +msgid "Angular" +msgstr "Ъглово" + +#: lcresourcestring.rsgradientdiamond +msgid "Diamond" +msgstr "Ромбовидно" + +#: lcresourcestring.rsgradientfill +msgid "Gradient fill" +msgstr "Преливане" + +#: lcresourcestring.rsgradientlinear +msgid "Linear" +msgstr "Линейно" + +#: lcresourcestring.rsgradientradial +msgid "Radial" +msgstr "Лъчево" + +#: lcresourcestring.rsgradientreflected +msgid "Reflected" +msgstr "Отражателно" + +#: lcresourcestring.rsgradientrepetition +msgid "Gradient repetition" +msgstr "Повтаряне на преливането" + +#: lcresourcestring.rsgrpad +msgid "Pad" +msgstr "" + +#: lcresourcestring.rsgrreflect +msgid "Reflect" +msgstr "Отразяване" + +#: lcresourcestring.rsgrrepeat +msgid "Repeat" +msgstr "Повтаряне" + +#: lcresourcestring.rsgrsine +msgid "Sine" +msgstr "Синусоидално" + +#: lcresourcestring.rsincompatibletype +msgid "Incompatible type" +msgstr "Несъвместим вид" + +#: lcresourcestring.rsindexoutofbounds +msgid "Index out of bounds" +msgstr "Указателят е извън границите" + +#: lcresourcestring.rslightposition +msgid "Light position" +msgstr "Разположение на светлината" + +#: lcresourcestring.rsloadtexture +msgid "Load texture" +msgstr "" + +#: lcresourcestring.rsnofill +msgid "No fill" +msgstr "Без запълване" + +#: lcresourcestring.rsnottexturefill +msgid "It is not a texture fill" +msgstr "" + +#: lcresourcestring.rsopacity +msgid "Opacity" +msgstr "Прозрачност" + +#: lcresourcestring.rspreview +msgid "Preview" +msgstr "Преглед" + +#: lcresourcestring.rsshapeclassnotspecified +msgid "Shape class not specified" +msgstr "" + +#: lcresourcestring.rsshapenotfound +msgid "Shape not found" +msgstr "Формата не е намерена" + +#: lcresourcestring.rssolidcolor +msgid "Solid color" +msgstr "Плътен цвят" + +#: lcresourcestring.rsstartopacity +msgid "Start opacity" +msgstr "Начална прозрачност" + +#: lcresourcestring.rsswapcolors +msgid "Swap colors" +msgstr "Превключване на цвета" + +#: lcresourcestring.rstexturefill +msgid "Texture fill" +msgstr "" + +#: lcresourcestring.rstexturerepetition +msgid "Texture repetition" +msgstr "" + +#: lcresourcestring.rstrnone +msgid "No repetition" +msgstr "Без повтаряне" + +#: lcresourcestring.rstrrepeatboth +msgid "Repeat both" +msgstr "Повтаряне и по двете" + +#: lcresourcestring.rstrrepeatx +msgid "Repeat X" +msgstr "Повтаряне по X" + +#: lcresourcestring.rstrrepeaty +msgid "Repeat Y" +msgstr "Повтаряне по Y" + +#: lcresourcestring.rsunknownshapeclass +msgid "Unknown shape class \"%1\"" +msgstr "" From 7e69affea13bbc3d1b12e1f550d0799fa61fe705 Mon Sep 17 00:00:00 2001 From: johann Date: Sun, 22 Mar 2020 11:19:21 +0100 Subject: [PATCH 30/53] fix update original when only editor changes --- lazpaint/image/uimage.pas | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lazpaint/image/uimage.pas b/lazpaint/image/uimage.pas index 313e5ac5..f6ef1e5c 100644 --- a/lazpaint/image/uimage.pas +++ b/lazpaint/image/uimage.pas @@ -1076,7 +1076,8 @@ procedure TLazPaintImage.OriginalChange(ASender: TObject; r: TRect; begin r := FCurrentState.LayeredBitmap.RenderOriginalIfNecessary(AOriginal.Guid, FDraftOriginal); - ImageMayChange(r, false); + if r.IsEmpty then OnImageChanged.NotifyObservers + else ImageMayChange(r, false); if Assigned(ADiff) then begin AddUndo(TVectorOriginalEmbeddedDifference.Create(CurrentState,AOriginal.Guid,ADiff,r)); From 2b0699092457168fd174d789b12a1d315df987a5 Mon Sep 17 00:00:00 2001 From: johann Date: Sun, 22 Mar 2020 11:28:04 +0100 Subject: [PATCH 31/53] factor fill diff code, add IsUpdating --- lazpaintcontrols/lcvectororiginal.pas | 74 +++++++++++++++++---------- 1 file changed, 46 insertions(+), 28 deletions(-) diff --git a/lazpaintcontrols/lcvectororiginal.pas b/lazpaintcontrols/lcvectororiginal.pas index ba235903..2b38a092 100644 --- a/lazpaintcontrols/lcvectororiginal.pas +++ b/lazpaintcontrols/lcvectororiginal.pas @@ -162,6 +162,7 @@ TVectorShape = class FFillBeforeChangeBounds: TRectF; function GetIsBack: boolean; function GetIsFront: boolean; + function GetIsUpdating: boolean; procedure SetContainer(AValue: TVectorOriginal); function GetFill(var AFillVariable: TVectorialFill): TVectorialFill; procedure SetFill(var AFillVariable: TVectorialFill; AValue: TVectorialFill; AUpdate: boolean); @@ -201,6 +202,7 @@ TVectorShape = class procedure RetrieveRenderStorage(AMatrix: TAffineMatrix; out ARenderBounds: TRect; out AImage: TBGRABitmap); function CanHaveRenderStorage: boolean; function AddDiffHandler(AClass: TVectorShapeDiffAny): TVectorShapeDiff; + procedure AddFillDiffHandler(AFill: TVectorialFill; ADiff: TCustomVectorialFillDiff); function GetDiffHandler(AClass: TVectorShapeDiffAny): TVectorShapeDiff; function GetIsFollowingMouse: boolean; virtual; public @@ -270,6 +272,7 @@ TVectorShape = class property IsRemoving: boolean read FRemoving; property Id: integer read FId write SetId; property IsFollowingMouse: boolean read GetIsFollowingMouse; + property IsUpdating: boolean read GetIsUpdating; end; TVectorShapes = specialize TFPGList; TVectorShapeAny = class of TVectorShape; @@ -1496,6 +1499,11 @@ procedure TVectorShape.SetContainer(AValue: TVectorOriginal); FContainer:=AValue; end; +function TVectorShape.GetIsUpdating: boolean; +begin + result := FUpdateCount > 0; +end; + function TVectorShape.GetFill(var AFillVariable: TVectorialFill): TVectorialFill; begin if AFillVariable = nil then @@ -1737,13 +1745,13 @@ function TVectorShape.GetStroker: TBGRAPenStroker; procedure TVectorShape.FillChange(ASender: TObject; var ADiff: TCustomVectorialFillDiff); var field: TVectorShapeField; - h: TVectorShapeCommonFillDiff; r: TRectF; begin r := FFillBeforeChangeBounds; FFillBeforeChangeBounds := EmptyRectF; if FFillChangeWithoutUpdate then exit; - if FUpdateCount=0 then + //if shape is not being updating, send the fill diff as such + if not IsUpdating then begin inc(FRenderIteration); if ASender = FPenFill then field := vsfPenFill @@ -1762,31 +1770,7 @@ procedure TVectorShape.FillChange(ASender: TObject; var ADiff: TCustomVectorialF end else DoOnChange(r, nil); end else - if (FUpdateCount>0) and Assigned(ADiff) then - begin - if GetDiffHandler(TVectorShapeCommonFillDiff)=nil then - begin - h := AddDiffHandler(TVectorShapeCommonFillDiff) as TVectorShapeCommonFillDiff; - if Assigned(h) then - begin - if ASender = FPenFill then - begin - if h.FStartPenFill=nil then h.FStartPenFill := TVectorialFill.Create; - ADiff.Unapply(h.FStartPenFill) - end - else if ASender = FBackFill then - begin - if h.FStartBackFill=nil then h.FStartBackFill := TVectorialFill.Create; - ADiff.Unapply(h.FStartBackFill); - end - else if ASender = FOutlineFill then - begin - if h.FStartOutlineFill=nil then h.FStartOutlineFill := TVectorialFill.Create; - ADiff.Unapply(h.FStartOutlineFill); - end; - end; - end; - end; + AddFillDiffHandler(ASender as TVectorialFill, ADiff); end; procedure TVectorShape.FillBeforeChange(ASender: TObject); @@ -1861,7 +1845,7 @@ function TVectorShape.AddDiffHandler(AClass: TVectorShapeDiffAny): TVectorShapeD i: Integer; begin result := nil; - if FUpdateCount <= 0 then + if not IsUpdating then raise exception.Create(errDiffHandlerOnlyDuringUpdate); if Assigned(FOnChange) then begin @@ -1873,6 +1857,40 @@ function TVectorShape.AddDiffHandler(AClass: TVectorShapeDiffAny): TVectorShapeD end; end; +procedure TVectorShape.AddFillDiffHandler(AFill: TVectorialFill; ADiff: TCustomVectorialFillDiff); +var + h: TVectorShapeCommonFillDiff; +begin + if Assigned(AFill) and Assigned(ADiff) then + begin + //make sure there is a handler for fill diff + if GetDiffHandler(TVectorShapeCommonFillDiff)=nil then + begin + h := AddDiffHandler(TVectorShapeCommonFillDiff) as TVectorShapeCommonFillDiff; + if Assigned(h) then + begin + //handler is initialized with current fill that is already changed + //so we need to fix the start value using diff + if AFill = FPenFill then + begin + if h.FStartPenFill=nil then h.FStartPenFill := TVectorialFill.Create; + ADiff.Unapply(h.FStartPenFill) + end + else if AFill = FBackFill then + begin + if h.FStartBackFill=nil then h.FStartBackFill := TVectorialFill.Create; + ADiff.Unapply(h.FStartBackFill); + end + else if AFill = FOutlineFill then + begin + if h.FStartOutlineFill=nil then h.FStartOutlineFill := TVectorialFill.Create; + ADiff.Unapply(h.FStartOutlineFill); + end; + end; + end; + end; +end; + function TVectorShape.GetDiffHandler(AClass: TVectorShapeDiffAny): TVectorShapeDiff; var i: Integer; From 284b15d27f33607552ad7724da07c83e7205f4d4 Mon Sep 17 00:00:00 2001 From: johann Date: Sun, 22 Mar 2020 11:34:13 +0100 Subject: [PATCH 32/53] no join diff if equals --- lazpaintcontrols/lcvectororiginal.pas | 1 + 1 file changed, 1 insertion(+) diff --git a/lazpaintcontrols/lcvectororiginal.pas b/lazpaintcontrols/lcvectororiginal.pas index 2b38a092..3b60580b 100644 --- a/lazpaintcontrols/lcvectororiginal.pas +++ b/lazpaintcontrols/lcvectororiginal.pas @@ -1307,6 +1307,7 @@ function TVectorShape.GetJoinStyle: TPenJoinStyle; procedure TVectorShape.SetJoinStyle(AValue: TPenJoinStyle); begin + if Stroker.JoinStyle = AValue then exit; BeginUpdate(TVectorShapeCommonDiff); Stroker.JoinStyle := AValue; EndUpdate; From 64e92becf1379ecafa483678eb532a8e5de496c0 Mon Sep 17 00:00:00 2001 From: johann Date: Sun, 22 Mar 2020 11:34:56 +0100 Subject: [PATCH 33/53] make sure diffs are freed --- lazpaintcontrols/lcvectororiginal.pas | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lazpaintcontrols/lcvectororiginal.pas b/lazpaintcontrols/lcvectororiginal.pas index 3b60580b..b479aab1 100644 --- a/lazpaintcontrols/lcvectororiginal.pas +++ b/lazpaintcontrols/lcvectororiginal.pas @@ -1972,11 +1972,16 @@ class function TVectorShape.CreateFromStorage( end; destructor TVectorShape.Destroy; +var + i: Integer; begin FreeAndNil(FStroker); FreeAndNil(FPenFill); FreeAndNil(FBackFill); FreeAndNil(FOutlineFill); + if Assigned(FDiffs) then + for i := 0 to FDiffs.Count-1 do + FDiffs[i].Free; FreeAndNil(FDiffs); inherited Destroy; end; From aeebbde2c93d637f0453baca846bc26b9ebb78c4 Mon Sep 17 00:00:00 2001 From: johann Date: Sun, 22 Mar 2020 11:35:26 +0100 Subject: [PATCH 34/53] no pen style diff if equals --- lazpaintcontrols/lcvectororiginal.pas | 1 + 1 file changed, 1 insertion(+) diff --git a/lazpaintcontrols/lcvectororiginal.pas b/lazpaintcontrols/lcvectororiginal.pas index b479aab1..92bcbea3 100644 --- a/lazpaintcontrols/lcvectororiginal.pas +++ b/lazpaintcontrols/lcvectororiginal.pas @@ -1924,6 +1924,7 @@ procedure TVectorShape.SetPenWidth(AValue: single); procedure TVectorShape.SetPenStyle(AValue: TBGRAPenStyle); begin + if PenStyleEqual(AValue, Stroker.CustomPenStyle) then exit; BeginUpdate(TVectorShapeCommonDiff); Stroker.CustomPenStyle := AValue; EndUpdate; From dba0e6e8a57075f05648f01060a51b198116d9e5 Mon Sep 17 00:00:00 2001 From: johann Date: Sun, 22 Mar 2020 11:38:17 +0100 Subject: [PATCH 35/53] render bounds of range --- lazpaintcontrols/lcvectororiginal.pas | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lazpaintcontrols/lcvectororiginal.pas b/lazpaintcontrols/lcvectororiginal.pas index 92bcbea3..c24f79b4 100644 --- a/lazpaintcontrols/lcvectororiginal.pas +++ b/lazpaintcontrols/lcvectororiginal.pas @@ -391,7 +391,8 @@ TVectorOriginal = class(TBGRALayerCustomOriginal) procedure Render(ADest: TBGRABitmap; ARenderOffset: TPoint; AMatrix: TAffineMatrix; ADraft: boolean); override; procedure ConfigureEditor(AEditor: TBGRAOriginalEditor); override; function CreateEditor: TBGRAOriginalEditor; override; - function GetRenderBounds(ADestRect: TRect; {%H-}AMatrix: TAffineMatrix): TRect; override; + function GetRenderBounds(ADestRect: TRect; {%H-}AMatrix: TAffineMatrix): TRect; overload; override; + function GetRenderBounds(ADestRect: TRect; {%H-}AMatrix: TAffineMatrix; AStartIndex, AEndIndex: integer): TRect; overload; function GetAlignBounds(ADestRect: TRect; {%H-}AMatrix: TAffineMatrix): TRect; procedure LoadFromStorage(AStorage: TBGRACustomOriginalStorage); override; procedure SaveToStorage(AStorage: TBGRACustomOriginalStorage); override; @@ -2713,7 +2714,7 @@ function TVectorOriginal.GetShapesCost: integer; function TVectorOriginal.PreferDraftMode(AEditor: TBGRAOriginalEditor; const AMatrix: TAffineMatrix): boolean; begin - if Assigned(SelectedShape) then + if Assigned(SelectedShape) and Assigned(AEditor) then begin result := (AEditor.IsMovingPoint or SelectedShape.IsFollowingMouse) and SelectedShape.GetIsSlow(AMatrix); @@ -2843,6 +2844,12 @@ function TVectorOriginal.CreateEditor: TBGRAOriginalEditor; function TVectorOriginal.GetRenderBounds(ADestRect: TRect; AMatrix: TAffineMatrix): TRect; +begin + result := GetRenderBounds(ADestRect, AMatrix, 0, ShapeCount-1); +end; + +function TVectorOriginal.GetRenderBounds(ADestRect: TRect; + AMatrix: TAffineMatrix; AStartIndex, AEndIndex: integer): TRect; var area, shapeArea: TRectF; i: Integer; @@ -2852,7 +2859,7 @@ function TVectorOriginal.GetRenderBounds(ADestRect: TRect; begin area:= EmptyRectF; useStorage := Assigned(RenderStorage) and (RenderStorage.AffineMatrix['last-matrix']=AMatrix); - for i:= 0 to FShapes.Count-1 do + for i:= AStartIndex to AEndIndex do begin if useStorage then begin From d5886c2e371342ef5b48ff778b525a8aed9226ad Mon Sep 17 00:00:00 2001 From: johann Date: Sun, 22 Mar 2020 18:55:25 +0100 Subject: [PATCH 36/53] factor PenVisible/BackVisible --- lazpaintcontrols/lcvectororiginal.pas | 25 ++++++ lazpaintcontrols/lcvectorpolyshapes.pas | 45 ++++------- lazpaintcontrols/lcvectorrectshapes.pas | 102 +++++++++--------------- lazpaintcontrols/lcvectortextshapes.pas | 8 +- 4 files changed, 78 insertions(+), 102 deletions(-) diff --git a/lazpaintcontrols/lcvectororiginal.pas b/lazpaintcontrols/lcvectororiginal.pas index c24f79b4..617ff00b 100644 --- a/lazpaintcontrols/lcvectororiginal.pas +++ b/lazpaintcontrols/lcvectororiginal.pas @@ -205,6 +205,9 @@ TVectorShape = class procedure AddFillDiffHandler(AFill: TVectorialFill; ADiff: TCustomVectorialFillDiff); function GetDiffHandler(AClass: TVectorShapeDiffAny): TVectorShapeDiff; function GetIsFollowingMouse: boolean; virtual; + function GetPenVisible(AAssumePenFill: boolean = False): boolean; virtual; + function GetPenVisibleNow: boolean; + function GetBackVisible: boolean; virtual; public constructor Create(AContainer: TVectorOriginal); virtual; class function CreateFromStorage(AStorage: TBGRACustomOriginalStorage; AContainer: TVectorOriginal): TVectorShape; @@ -273,6 +276,8 @@ TVectorShape = class property Id: integer read FId write SetId; property IsFollowingMouse: boolean read GetIsFollowingMouse; property IsUpdating: boolean read GetIsUpdating; + property BackVisible: boolean read GetBackVisible; + property PenVisible: boolean read GetPenVisibleNow; end; TVectorShapes = specialize TFPGList; TVectorShapeAny = class of TVectorShape; @@ -1579,6 +1584,26 @@ function TVectorShape.GetIsFollowingMouse: boolean; result := false; end; +function TVectorShape.GetPenVisible(AAssumePenFill: boolean): boolean; +var + f: TVectorShapeFields; +begin + f := Fields; + result := (vsfPenFill in f) and (not PenFill.IsFullyTransparent or AAssumePenFill); + if result and (vsfPenWidth in f) then result := result and (PenWidth>0); + if result and (vsfPenStyle in f) then result := result and not IsClearPenStyle(PenStyle); +end; + +function TVectorShape.GetPenVisibleNow: boolean; +begin + result := GetPenVisible(False); +end; + +function TVectorShape.GetBackVisible: boolean; +begin + result := (vsfBackFill in Fields) and not BackFill.IsFullyTransparent; +end; + procedure TVectorShape.TransformFill(const AMatrix: TAffineMatrix; ABackOnly: boolean); begin BeginUpdate; diff --git a/lazpaintcontrols/lcvectorpolyshapes.pas b/lazpaintcontrols/lcvectorpolyshapes.pas index e929d5ae..8eec4e2e 100644 --- a/lazpaintcontrols/lcvectorpolyshapes.pas +++ b/lazpaintcontrols/lcvectorpolyshapes.pas @@ -136,9 +136,6 @@ TCustomPolypointShape = class(TVectorShape) { TPolylineShape } TPolylineShape = class(TCustomPolypointShape) - protected - function PenVisible(AAssumePenFill: boolean = false): boolean; - function BackVisible: boolean; public class function Fields: TVectorShapeFields; override; procedure Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; ADraft: boolean); overload; override; @@ -1161,16 +1158,6 @@ procedure TCustomPolypointShape.TransformFrame(const AMatrix: TAffineMatrix); { TPolylineShape } -function TPolylineShape.PenVisible(AAssumePenFill: boolean): boolean; -begin - result := (PenWidth>0) and not IsClearPenStyle(PenStyle) and (not PenFill.IsFullyTransparent or AAssumePenFill); -end; - -function TPolylineShape.BackVisible: boolean; -begin - result := not BackFill.IsFullyTransparent; -end; - class function TPolylineShape.Fields: TVectorShapeFields; begin Result:= [vsfPenFill, vsfPenWidth, vsfPenStyle, vsfJoinStyle, vsfBackFill]; @@ -1182,9 +1169,9 @@ procedure TPolylineShape.Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; pts: array of TPointF; backScan, penScan: TBGRACustomScanner; begin - if not BackVisible and not PenVisible then exit; + if not GetBackVisible and not GetPenVisible then exit; pts := GetCurve(AMatrix); - if BackVisible then + if GetBackVisible then begin if BackFill.FillType = vftSolid then backScan := nil else backScan := BackFill.CreateScanner(AMatrix, ADraft); @@ -1204,7 +1191,7 @@ procedure TPolylineShape.Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; backScan.Free; end; - if PenVisible then + if GetPenVisible then begin if PenFill.FillType = vftSolid then penScan := nil else penScan := PenFill.CreateScanner(AMatrix, ADraft); @@ -1233,12 +1220,12 @@ function TPolylineShape.GetRenderBounds(ADestRect: TRect; AMatrix: TAffineMatrix xMargin, yMargin: single; fillBounds, penBounds: TRectF; begin - if not (BackVisible or (rboAssumeBackFill in AOptions)) and not PenVisible(rboAssumePenFill in AOptions) then + if not (GetBackVisible or (rboAssumeBackFill in AOptions)) and not GetPenVisible(rboAssumePenFill in AOptions) then result:= EmptyRectF else begin pts := GetCurve(AMatrix); - if PenVisible(rboAssumePenFill in AOptions) then + if GetPenVisible(rboAssumePenFill in AOptions) then begin if (JoinStyle = pjsRound) and (ArrowStartKind = akNone) and (ArrowEndKind = akNone) then begin @@ -1251,7 +1238,7 @@ function TPolylineShape.GetRenderBounds(ADestRect: TRect; AMatrix: TAffineMatrix result.Bottom += yMargin; end else begin - if BackVisible or (rboAssumeBackFill in AOptions) then fillBounds := GetPointsBoundsF(pts) + if GetBackVisible or (rboAssumeBackFill in AOptions) then fillBounds := GetPointsBoundsF(pts) else fillBounds := EmptyRectF; pts := ComputeStroke(pts, Closed, AMatrix); penBounds := GetPointsBoundsF(pts); @@ -1268,10 +1255,10 @@ function TPolylineShape.PointInShape(APoint: TPointF): boolean; var pts: ArrayOfTPointF; begin - if not BackVisible and not PenVisible then exit(false); + if not GetBackVisible and not GetPenVisible then exit(false); pts := GetCurve(AffineMatrixIdentity); - if BackVisible and IsPointInPolygon(pts, APoint, true) then exit(true); - if PenVisible then + if GetBackVisible and IsPointInPolygon(pts, APoint, true) then exit(true); + if GetPenVisible then begin pts := ComputeStroke(pts, Closed, AffineMatrixIdentity); if IsPointInPolygon(pts, APoint, true) then exit(true); @@ -1283,7 +1270,7 @@ function TPolylineShape.PointInShape(APoint: TPointF; ARadius: single): boolean; var pts: ArrayOfTPointF; begin - if not BackVisible and not PenVisible then exit(false); + if not GetBackVisible and not GetPenVisible then exit(false); pts := GetCurve(AffineMatrixIdentity); pts := ComputeStrokeEnvelope(pts, Closed, ARadius*2); result := IsPointInPolygon(pts, APoint, true); @@ -1294,7 +1281,7 @@ function TPolylineShape.PointInBack(APoint: TPointF): boolean; pts: ArrayOfTPointF; scan: TBGRACustomScanner; begin - if BackVisible then + if GetBackVisible then begin pts := GetCurve(AffineMatrixIdentity); result := IsPointInPolygon(pts, APoint, true); @@ -1312,7 +1299,7 @@ function TPolylineShape.PointInPen(APoint: TPointF): boolean; var pts: ArrayOfTPointF; begin - if BackVisible then + if GetBackVisible then begin pts := GetCurve(AffineMatrixIdentity); pts := ComputeStroke(pts, Closed, AffineMatrixIdentity); @@ -1328,13 +1315,13 @@ function TPolylineShape.GetIsSlow(const AMatrix: TAffineMatrix): boolean; backSurface: Single; penLength, zoomFactor, penSurface, totalSurface: single; begin - if not PenVisible and not BackVisible or (PointCount = 0) then exit(false); + if not GetPenVisible and not GetBackVisible or (PointCount = 0) then exit(false); setlength(pts, PointCount); for i := 0 to high(pts) do pts[i] := AMatrix * Points[i]; - if PenVisible then + if GetPenVisible then begin penLength := 0; zoomFactor := max(VectLen(AMatrix[1,1],AMatrix[2,1]), VectLen(AMatrix[1,2],AMatrix[2,2])); @@ -1354,14 +1341,14 @@ function TPolylineShape.GetIsSlow(const AMatrix: TAffineMatrix): boolean; penSurface := penLength*PenWidth*zoomFactor; end else penSurface := 0; - if BackVisible then + if GetBackVisible then begin ptsBounds := GetPointsBoundsF(pts); backSurface := ptsBounds.Width*ptsBounds.Height; end else backSurface := 0; - if PenVisible and BackVisible then totalSurface := backSurface+penSurface/2 + if GetPenVisible and GetBackVisible then totalSurface := backSurface+penSurface/2 else totalSurface := backSurface+penSurface; Result:= (PointCount > 40) or diff --git a/lazpaintcontrols/lcvectorrectshapes.pas b/lazpaintcontrols/lcvectorrectshapes.pas index 15832ee0..cadd805f 100644 --- a/lazpaintcontrols/lcvectorrectshapes.pas +++ b/lazpaintcontrols/lcvectorrectshapes.pas @@ -95,8 +95,6 @@ TCustomRectShape = class(TVectorShape) TRectShape = class(TCustomRectShape) protected - function PenVisible(AAssumePenFill: boolean = false): boolean; - function BackVisible: boolean; function GetCornerPositition: single; override; public class function Fields: TVectorShapeFields; override; @@ -114,8 +112,6 @@ TRectShape = class(TCustomRectShape) TEllipseShape = class(TCustomRectShape) protected - function PenVisible(AAssumePenFill: boolean = false): boolean; - function BackVisible: boolean; function GetCornerPositition: single; override; public constructor Create(AContainer: TVectorOriginal); override; @@ -174,7 +170,6 @@ TPhongShape = class(TCustomRectShape) procedure SetLightPosition(AValue: TPointF); procedure SetShapeAltitudePercent(AValue: single); procedure SetShapeKind(AValue: TPhongShapeKind); - function BackVisible: boolean; function GetEnvelope: ArrayOfTPointF; public constructor Create(AContainer: TVectorOriginal); override; @@ -892,16 +887,6 @@ procedure TCustomRectShape.ConfigureCustomEditor(AEditor: TBGRAOriginalEditor); { TRectShape } -function TRectShape.PenVisible(AAssumePenFill: boolean): boolean; -begin - result := (PenWidth>0) and not IsClearPenStyle(PenStyle) and (not PenFill.IsFullyTransparent or AAssumePenFill); -end; - -function TRectShape.BackVisible: boolean; -begin - result := not BackFill.IsFullyTransparent; -end; - function TRectShape.GetCornerPositition: single; begin result := 1; @@ -912,24 +897,24 @@ function TRectShape.GetIsSlow(const AMatrix: TAffineMatrix): boolean; ab: TAffineBox; backSurface, totalSurface, penSurface: Single; begin - if not PenVisible and not BackVisible then + if not GetPenVisible and not GetBackVisible then result := false else begin ab := GetAffineBox(AMatrix, true); backSurface := ab.Surface; - if PenVisible then + if GetPenVisible then begin penSurface := (ab.Width+ab.Height)*2*PenWidth; - if BackVisible then + if GetBackVisible then totalSurface:= backSurface+penSurface/2 else totalSurface := penSurface; end else totalSurface := backSurface; result := (totalSurface > 800*600) or - ((backSurface > 320*240) and BackVisible and BackFill.IsSlow(AMatrix)) or - ((penSurface > 320*240) and PenVisible and PenFill.IsSlow(AMatrix)); + ((backSurface > 320*240) and GetBackVisible and BackFill.IsSlow(AMatrix)) or + ((penSurface > 320*240) and GetPenVisible and PenFill.IsSlow(AMatrix)); end; end; @@ -950,7 +935,7 @@ procedure TRectShape.Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; i: Integer; begin pts := GetAffineBox(AMatrix, true).AsPolygon; - If BackVisible then + If GetBackVisible then begin if (BackFill.FillType = vftSolid) then backScan := nil else backScan := BackFill.CreateScanner(AMatrix, ADraft); @@ -1015,7 +1000,7 @@ procedure TRectShape.Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; backScan.Free; end; - if PenVisible then + if GetPenVisible then begin if (PenFill.FillType = vftSolid) then penScan := nil else penScan := PenFill.CreateScanner(AMatrix, ADraft); @@ -1044,12 +1029,12 @@ function TRectShape.GetRenderBounds(ADestRect: TRect; AMatrix: TAffineMatrix; AO pts: ArrayOfTPointF; xMargin, yMargin: single; begin - if not (BackVisible or (rboAssumeBackFill in AOptions)) and not PenVisible(rboAssumePenFill in AOptions) then + if not (GetBackVisible or (rboAssumeBackFill in AOptions)) and not GetPenVisible(rboAssumePenFill in AOptions) then result:= EmptyRectF else begin result := inherited GetRenderBounds(ADestRect, AMatrix, AOptions); - if PenVisible(rboAssumePenFill in AOptions) then + if GetPenVisible(rboAssumePenFill in AOptions) then begin if (JoinStyle <> pjsMiter) or (Stroker.MiterLimit <= 1) then begin @@ -1080,9 +1065,9 @@ function TRectShape.PointInShape(APoint: TPointF): boolean; box: TAffineBox; begin box := GetAffineBox(AffineMatrixIdentity, true); - if BackVisible and box.Contains(APoint) then + if GetBackVisible and box.Contains(APoint) then result := true else - if PenVisible then + if GetPenVisible then begin pts := ComputeStroke(box.AsPolygon, true, AffineMatrixIdentity); result:= IsPointInPolygon(pts, APoint, true); @@ -1095,7 +1080,7 @@ function TRectShape.PointInShape(APoint: TPointF; ARadius: single): boolean; pts: ArrayOfTPointF; box: TAffineBox; begin - if PenVisible or BackVisible then + if GetPenVisible or GetBackVisible then begin box := GetAffineBox(AffineMatrixIdentity, true); pts := ComputeStrokeEnvelope(box.AsPolygon, true, ARadius*2); @@ -1109,7 +1094,7 @@ function TRectShape.PointInBack(APoint: TPointF): boolean; box: TAffineBox; scan: TBGRACustomScanner; begin - if BackVisible then + if GetBackVisible then begin box := GetAffineBox(AffineMatrixIdentity, true); result := box.Contains(APoint); @@ -1127,7 +1112,7 @@ function TRectShape.PointInPen(APoint: TPointF): boolean; var pts: ArrayOfTPointF; begin - if PenVisible then + if GetPenVisible then begin pts := GetAffineBox(AffineMatrixIdentity, true).AsPolygon; pts := ComputeStroke(pts,true, AffineMatrixIdentity); @@ -1143,16 +1128,6 @@ class function TRectShape.StorageClassName: RawByteString; { TEllipseShape } -function TEllipseShape.PenVisible(AAssumePenFill: boolean): boolean; -begin - result := (PenWidth>0) and not IsClearPenStyle(PenStyle) and (not PenFill.IsFullyTransparent or AAssumePenFill); -end; - -function TEllipseShape.BackVisible: boolean; -begin - result := not BackFill.IsFullyTransparent; -end; - function TEllipseShape.GetCornerPositition: single; begin result := sqrt(2)/2; @@ -1196,7 +1171,7 @@ function TEllipseShape.GetAlignBounds(const ALayoutRect: TRect; IncludePoint(m*YAxis); IncludePoint(m*(Origin-(XAxis-Origin))); IncludePoint(m*(Origin-(YAxis-Origin))); - if PenVisible then + if GetPenVisible then begin zoom := (VectLen(AMatrix[1,1],AMatrix[2,1])+VectLen(AMatrix[1,2],AMatrix[2,2]))/2; result.Left -= zoom*PenWidth/2; @@ -1223,7 +1198,7 @@ procedure TEllipseShape.Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; begin center := (orthoRect.TopLeft+orthoRect.BottomRight)*0.5; radius := (orthoRect.BottomRight-orthoRect.TopLeft)*0.5; - If BackVisible then + If GetBackVisible then begin if BackFill.FillType = vftSolid then backScan := nil else backScan := BackFill.CreateScanner(AMatrix, ADraft); @@ -1244,7 +1219,7 @@ procedure TEllipseShape.Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; backScan.Free; end; - if PenVisible then + if GetPenVisible then begin if PenFill.FillType = vftSolid then penScan := nil else penScan := PenFill.CreateScanner(AMatrix, ADraft); @@ -1288,7 +1263,7 @@ procedure TEllipseShape.Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; begin m:= MatrixForPixelCentered(AMatrix); pts := ComputeEllipse(m*FOrigin, m*FXAxis, m*FYAxis); - If BackVisible then + If GetBackVisible then begin if BackFill.FillType = vftSolid then backScan := nil else backScan := BackFill.CreateScanner(AMatrix, ADraft); @@ -1308,7 +1283,7 @@ procedure TEllipseShape.Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; backScan.Free; end; - if PenVisible then + if GetPenVisible then begin if PenFill.FillType = vftSolid then penScan := nil else penScan := PenFill.CreateScanner(AMatrix, ADraft); @@ -1336,12 +1311,12 @@ function TEllipseShape.GetRenderBounds({%H-}ADestRect: TRect; AMatrix: TAffineMa var xMargin, yMargin: single; begin - if not (BackVisible or (rboAssumeBackFill in AOptions)) and not PenVisible(rboAssumePenFill in AOptions) then + if not (GetBackVisible or (rboAssumeBackFill in AOptions)) and not GetPenVisible(rboAssumePenFill in AOptions) then result:= EmptyRectF else begin result := inherited GetRenderBounds(ADestRect, AMatrix, AOptions); - if PenVisible(rboAssumePenFill in AOptions) then + if GetPenVisible(rboAssumePenFill in AOptions) then begin xMargin := (abs(AMatrix[1,1])+abs(AMatrix[1,2]))*PenWidth*0.5; yMargin := (abs(AMatrix[2,1])+abs(AMatrix[2,2]))*PenWidth*0.5; @@ -1358,9 +1333,9 @@ function TEllipseShape.PointInShape(APoint: TPointF): boolean; pts: ArrayOfTPointF; begin pts := ComputeEllipse(FOrigin, FXAxis, FYAxis); - if BackVisible and IsPointInPolygon(pts, APoint, true) then + if GetBackVisible and IsPointInPolygon(pts, APoint, true) then result := true else - if PenVisible then + if GetPenVisible then begin pts := ComputeStroke(pts, true, AffineMatrixIdentity); result:= IsPointInPolygon(pts, APoint, true); @@ -1372,7 +1347,7 @@ function TEllipseShape.PointInShape(APoint: TPointF; ARadius: single): boolean; var pts: ArrayOfTPointF; begin - if PenVisible or BackVisible then + if GetPenVisible or GetBackVisible then begin pts := ComputeEllipse(FOrigin, FXAxis, FYAxis); pts := ComputeStrokeEnvelope(pts, true, ARadius*2); @@ -1386,7 +1361,7 @@ function TEllipseShape.PointInBack(APoint: TPointF): boolean; pts: ArrayOfTPointF; scan: TBGRACustomScanner; begin - if BackVisible then + if GetBackVisible then begin pts := ComputeEllipse(FOrigin, FXAxis, FYAxis); result:= IsPointInPolygon(pts, APoint, true); @@ -1404,7 +1379,7 @@ function TEllipseShape.PointInPen(APoint: TPointF): boolean; var pts: ArrayOfTPointF; begin - if PenVisible then + if GetPenVisible then begin pts := ComputeEllipse(FOrigin, FXAxis, FYAxis); pts := ComputeStroke(pts,true, AffineMatrixIdentity); @@ -1418,24 +1393,24 @@ function TEllipseShape.GetIsSlow(const AMatrix: TAffineMatrix): boolean; ab: TAffineBox; backSurface, totalSurface, penSurface: Single; begin - if not PenVisible and not BackVisible then + if not GetPenVisible and not GetBackVisible then result := false else begin ab := GetAffineBox(AMatrix, true); backSurface := ab.Surface*Pi/4; - if PenVisible then + if GetPenVisible then begin penSurface := (ab.Width+ab.Height)*(Pi/2)*PenWidth; - if BackVisible then + if GetBackVisible then totalSurface:= backSurface+penSurface/2 else totalSurface := penSurface; end else totalSurface := backSurface; result := (totalSurface > 640*480) or - ((backSurface > 320*240) and BackVisible and BackFill.IsSlow(AMatrix)) or - ((penSurface > 320*240) and PenVisible and PenFill.IsSlow(AMatrix)); + ((backSurface > 320*240) and GetBackVisible and BackFill.IsSlow(AMatrix)) or + ((penSurface > 320*240) and GetPenVisible and PenFill.IsSlow(AMatrix)); end; end; @@ -1484,11 +1459,6 @@ procedure TPhongShape.SetShapeAltitudePercent(AValue: single); EndUpdate; end; -function TPhongShape.BackVisible: boolean; -begin - result := not BackFill.IsFullyTransparent; -end; - function TPhongShape.GetEnvelope: ArrayOfTPointF; var box: TAffineBox; @@ -1662,7 +1632,7 @@ procedure TPhongShape.Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; rectRenderF,rectRasterF: TRectF; rectRender,rectRaster, prevClip: TRect; begin - if not BackVisible then exit; + if not GetBackVisible then exit; //determine final render bounds rectRenderF := GetRenderBounds(InfiniteRect,AMatrix); @@ -1790,7 +1760,7 @@ procedure TPhongShape.Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; function TPhongShape.GetRenderBounds(ADestRect: TRect; AMatrix: TAffineMatrix; AOptions: TRenderBoundsOptions): TRectF; begin - if not (BackVisible or (rboAssumeBackFill in AOptions)) then + if not (GetBackVisible or (rboAssumeBackFill in AOptions)) then result:= EmptyRectF else result := inherited GetRenderBounds(ADestRect, AMatrix, AOptions); @@ -1800,7 +1770,7 @@ function TPhongShape.PointInShape(APoint: TPointF): boolean; var pts: ArrayOfTPointF; begin - if not BackVisible then exit(false); + if not GetBackVisible then exit(false); pts := GetEnvelope; result := IsPointInPolygon(pts, APoint, true); end; @@ -1809,7 +1779,7 @@ function TPhongShape.PointInShape(APoint: TPointF; ARadius: single): boolean; var pts: ArrayOfTPointF; begin - if BackVisible then + if GetBackVisible then begin pts := ComputeStrokeEnvelope(GetEnvelope, true, ARadius*2); result:= IsPointInPolygon(pts, APoint, true); @@ -1834,7 +1804,7 @@ function TPhongShape.GetIsSlow(const AMatrix: TAffineMatrix): boolean; var ab: TAffineBox; begin - if not BackVisible then exit(false); + if not GetBackVisible then exit(false); ab := GetAffineBox(AMatrix, true); result := ab.Surface > 320*240; end; diff --git a/lazpaintcontrols/lcvectortextshapes.pas b/lazpaintcontrols/lcvectortextshapes.pas index 7a3b38ba..bcbb2066 100644 --- a/lazpaintcontrols/lcvectortextshapes.pas +++ b/lazpaintcontrols/lcvectortextshapes.pas @@ -120,7 +120,6 @@ TTextShape = class(TCustomRectShape) FGlobalMatrix: TAffineMatrix; procedure DoOnChange(ABoundsBefore: TRectF; ADiff: TVectorShapeDiff); override; procedure SetGlobalMatrix(AMatrix: TAffineMatrix); - function PenVisible(AAssumePenFill: boolean = false): boolean; function ShowArrows: boolean; override; function GetTextLayout: TBidiTextLayout; function GetFontRenderer: TBGRACustomFontRenderer; @@ -731,11 +730,6 @@ procedure TTextShape.SetGlobalMatrix(AMatrix: TAffineMatrix); FGlobalMatrix := AMatrix; end; -function TTextShape.PenVisible(AAssumePenFill: boolean): boolean; -begin - result := not PenFill.IsFullyTransparent or AAssumePenFill; -end; - function TTextShape.AllowShearTransform: boolean; begin Result:= true; @@ -1469,7 +1463,7 @@ function TTextShape.GetRenderBounds(ADestRect: TRect; AMatrix: TAffineMatrix; u: TPointF; lenU, margin: Single; begin - if (PenVisible(rboAssumePenFill in AOptions) or HasOutline) and + if (GetPenVisible(rboAssumePenFill in AOptions) or HasOutline) and (Text <> '') then begin ab := GetAffineBox(AMatrix, false); From 7499e26aced9f76ca05924b579cc67976ff71142 Mon Sep 17 00:00:00 2001 From: johann Date: Sun, 22 Mar 2020 19:42:27 +0100 Subject: [PATCH 37/53] update toolbar on toolopen --- lazpaint/tools/utool.pas | 1 + 1 file changed, 1 insertion(+) diff --git a/lazpaint/tools/utool.pas b/lazpaint/tools/utool.pas index 4cf4887f..39cbcbb4 100644 --- a/lazpaint/tools/utool.pas +++ b/lazpaint/tools/utool.pas @@ -3516,6 +3516,7 @@ procedure TToolManager.ToolOpen; FInTool := true; try FCurrentTool := PaintTools[FCurrentToolType].Create(self); + UpdateContextualToolbars; finally FInTool := false; end; From 10333b3d39cf78718b837b6f2807a686488b87bd Mon Sep 17 00:00:00 2001 From: johann Date: Thu, 26 Mar 2020 13:02:24 +0100 Subject: [PATCH 38/53] outline fill interface, fix zoomed outline width and text size --- lazpaint/lazpaintmainform.lfm | 31 ++- lazpaint/lazpaintmainform.pas | 35 +-- lazpaint/lazpainttype.pas | 47 ++-- lazpaint/maintoolbar.inc | 269 ++++++++----------- lazpaint/tools/utool.pas | 242 ++++++++++++++--- lazpaint/tools/utooltext.pas | 62 +---- lazpaint/tools/utoolvectorial.pas | 339 ++++++++++++++---------- lazpaint/uconfig.pas | 24 ++ lazpaintcontrols/lcvectororiginal.pas | 58 ++-- lazpaintcontrols/lcvectortextshapes.pas | 4 +- scripts/lazpaint/tools.py | 45 ++++ 11 files changed, 706 insertions(+), 450 deletions(-) diff --git a/lazpaint/lazpaintmainform.lfm b/lazpaint/lazpaintmainform.lfm index 2341451f..03132039 100644 --- a/lazpaint/lazpaintmainform.lfm +++ b/lazpaint/lazpaintmainform.lfm @@ -2304,7 +2304,7 @@ object FMain: TFMain end end object Panel_PerspectiveOption: TPanel - Left = 479 + Left = 432 Height = 36 Top = 152 Width = 65 @@ -2603,7 +2603,7 @@ object FMain: TFMain end end object Panel_Ratio: TPanel - Left = 288 + Left = 272 Height = 36 Top = 152 Width = 147 @@ -3119,9 +3119,9 @@ object FMain: TFMain end end object Panel_Donate: TPanel - Left = 479 + Left = 512 Height = 36 - Top = 248 + Top = 152 Width = 44 ClientHeight = 36 ClientWidth = 44 @@ -3150,6 +3150,29 @@ object FMain: TFMain end end end + object Panel_OutlineFill: TPanel + Left = 480 + Height = 36 + Top = 240 + Width = 88 + ClientHeight = 36 + ClientWidth = 88 + Font.Height = -12 + ParentColor = False + ParentFont = False + PopupMenu = PopupToolbar + TabOrder = 33 + object VectorialFill_Outline: TLCVectorialFillControl + Left = 2 + Height = 40 + Top = 1 + Width = 80 + AutoSize = True + ToolIconSize = 16 + VerticalPadding = 4 + AllowedFillTypes = [vftSolid, vftGradient, vftTexture] + end + end object ImageList16: TBGRAImageList left = 40 top = 496 diff --git a/lazpaint/lazpaintmainform.pas b/lazpaint/lazpaintmainform.pas index 20dc1a1c..25ef225a 100644 --- a/lazpaint/lazpaintmainform.pas +++ b/lazpaint/lazpaintmainform.pas @@ -13,7 +13,7 @@ interface Graphics, Dialogs, Menus, ExtDlgs, ComCtrls, ActnList, StdCtrls, ExtCtrls, Buttons, types, LCLType, BGRAImageList, BCTrackbarUpdown, BCComboBox, BCButton, - BGRABitmap, BGRABitmapTypes, BGRALayers, BGRASVGOriginal, BGRAGradientScanner, + BGRABitmap, BGRABitmapTypes, BGRALayers, BGRASVGOriginal, BGRAGradientScanner, BGRAGradientOriginal, LazPaintType, UMainFormLayout, UTool, UImage, UImageAction, UZoom, UImageView, UImageObservation, UConfig, LCScaleDPI, UResourceStrings, UMenu, uscripting, @@ -29,6 +29,7 @@ TFMain = class(TForm) FileExport: TAction; ExportPictureDialog: TSaveDialog; MenuScript: TMenuItem; + Panel_OutlineFill: TPanel; Panel_Donate: TPanel; ToolButton_Donate: TToolButton; ToolBar25: TToolBar; @@ -58,6 +59,7 @@ TFMain = class(TForm) Tool_EraseSharpen: TToolButton; Tool_EraseLighten: TToolButton; Tool_EraseDarken: TToolButton; + VectorialFill_Outline: TLCVectorialFillControl; VectorialFill_Pen: TLCVectorialFillControl; VectorialFill_Back: TLCVectorialFillControl; Panel_BackFill: TPanel; @@ -641,9 +643,7 @@ TFMain = class(TForm) {%H-}Shift: TShiftState; {%H-}X, {%H-}Y: Integer); procedure SpinEdit_PenWidthChange(Sender: TObject; AByUser: boolean); procedure Tool_CloseShapeClick(Sender: TObject); - procedure VectorialFill_BackChooseColor({%H-}ASender: TObject; AButton: TMouseButton; - AColorIndex: integer; var {%H-}AColorValue: TBGRAPixel; out AHandled: boolean); - procedure VectorialFill_PenChooseColor({%H-}ASender: TObject; AButton: TMouseButton; + procedure VectorialFill_ChooseColor({%H-}ASender: TObject; AButton: TMouseButton; AColorIndex: integer; var {%H-}AColorValue: TBGRAPixel; out AHandled: boolean); procedure SpinEdit_ArrowSizeChange(Sender: TObject; AByUser: boolean); procedure SpinEdit_ToleranceChange(Sender: TObject; AByUser: boolean); @@ -688,20 +688,14 @@ TFMain = class(TForm) procedure ManagerToolbarChanged(Sender: TObject); procedure Perspective_RepeatClick(Sender: TObject); function ScriptShowColorDialog(AVars: TVariableSet): TScriptResult; - procedure VectorialFill_BackAdjustToShape(Sender: TObject); - procedure VectorialFill_BackChange(Sender: TObject); - procedure VectorialFill_BackEditGradTexPoints(Sender: TObject); - procedure VectorialFill_BackResize(Sender: TObject); - procedure VectorialFill_BackTypeChange(Sender: TObject); - procedure VectorialFill_PenAdjustToShape(Sender: TObject); - procedure VectorialFill_PenChange(Sender: TObject); - procedure VectorialFill_PenEditGradTexPoints(Sender: TObject); - procedure VectorialFill_PenResize(Sender: TObject); - procedure VectorialFill_PenTypeChange(Sender: TObject); - procedure VectorialFill_ShowBackFill(Sender: TObject; {%H-}Shift: TShiftState; - {%H-}X, {%H-}Y: Integer); - procedure VectorialFill_ShowPenFill(Sender: TObject; {%H-}Shift: TShiftState; {%H-}X, - {%H-}Y: Integer); + procedure VectorialFill_Change(Sender: TObject); + procedure VectorialFill_TypeChange(Sender: TObject); + procedure VectorialFill_Resize(Sender: TObject); + procedure VectorialFill_EditGradTexPoints(Sender: TObject); + procedure VectorialFill_AdjustToShape(Sender: TObject); + procedure VectorialFill_ShowBackFill(Sender: TObject; {%H-}Shift: TShiftState; {%H-}X, {%H-}Y: Integer); + procedure VectorialFill_ShowPenFill(Sender: TObject; {%H-}Shift: TShiftState; {%H-}X, {%H-}Y: Integer); + procedure VectorialFill_ShowOutlineFill(Sender: TObject; {%H-}Shift: TShiftState; {%H-}X, {%H-}Y: Integer); private { private declarations } FLayout: TMainFormLayout; @@ -813,8 +807,7 @@ TFMain = class(TForm) function ShowColorDialogFor(ATarget: TColorTarget): boolean; procedure ShowPenPreview(ShouldRepaint: boolean= False); procedure HidePenPreview(ATimeMs: Integer = 300; AClearTime: boolean = false); - procedure ShowPenFill; - procedure ShowBackFill; + procedure ShowFill(AFillControl: TLCVectorialFillControl; APanel: TPanel); procedure HideFill(ATimeMs: Integer = 300; AClearTime: boolean = false); procedure OnPaintHandler; procedure OnImageChangedHandler({%H-}AEvent: TLazPaintImageObservationEvent); @@ -1181,7 +1174,7 @@ procedure TFMain.FormShow(Sender: TObject); Panel_ShapeOption,Panel_PenWidth,Panel_PenStyle,Panel_JoinStyle, Panel_CloseShape,Panel_LineCap,Panel_Aliasing, Panel_SplineStyle,Panel_Eraser,Panel_Tolerance,Panel_Text,Panel_Altitude,Panel_TextShadow,Panel_TextOutline, - Panel_PhongShape,Panel_PerspectiveOption,Panel_Brush,Panel_Ratio,Panel_Donate],Panel_ToolbarBackground); + Panel_OutlineFill,Panel_PhongShape,Panel_PerspectiveOption,Panel_Brush,Panel_Ratio,Panel_Donate],Panel_ToolbarBackground); m.ImageList := LazPaintInstance.Icons[ScaleY(16, 96)]; m.Apply; FLayout.Menu := m; diff --git a/lazpaint/lazpainttype.pas b/lazpaint/lazpainttype.pas index f665579e..180967d9 100644 --- a/lazpaint/lazpainttype.pas +++ b/lazpaint/lazpainttype.pas @@ -109,7 +109,8 @@ function IsOnlyRenderChange(const ARect:TRect): boolean; type ArrayOfBGRABitmap = array of TBGRABitmap; TColorTarget = (ctForeColorSolid, ctForeColorStartGrad, ctForeColorEndGrad, - ctBackColorSolid, ctBackColorStartGrad, ctBackColorEndGrad); + ctBackColorSolid, ctBackColorStartGrad, ctBackColorEndGrad, + ctOutlineColorSolid, ctOutlineColorStartGrad, ctOutlineColorEndGrad); TFlipOption = (foAuto, foWholePicture, foSelection, foCurrentLayer); PImageEntry = ^TImageEntry; @@ -647,30 +648,40 @@ function TLazPaintCustomInstance.GetZoomFactor: single; end; function TLazPaintCustomInstance.GetColor(ATarget: TColorTarget): TBGRAPixel; + function GetStartColor(AFill: TVectorialFill): TBGRAPixel; + begin + if AFill.FillType = vftGradient then + result := AFill.Gradient.StartColor + else result := AFill.AverageColor; + end; + function GetEndColor(AFill: TVectorialFill): TBGRAPixel; + begin + if AFill.FillType = vftGradient then + result := AFill.Gradient.EndColor + else result := AFill.AverageColor; + end; + begin case ATarget of - ctForeColorSolid: result := ToolManager.ForeColor; - ctForeColorStartGrad: if ToolManager.ForeFill.FillType = vftGradient then - result := ToolManager.ForeFill.Gradient.StartColor - else result := ToolManager.ForeColor; - ctForeColorEndGrad: if ToolManager.ForeFill.FillType = vftGradient then - result := ToolManager.ForeFill.Gradient.EndColor - else result := ToolManager.ForeColor; - ctBackColorSolid: result := ToolManager.BackColor; - ctBackColorStartGrad: if ToolManager.BackFill.FillType = vftGradient then - result := ToolManager.BackFill.Gradient.StartColor - else result := ToolManager.BackColor; - ctBackColorEndGrad: if ToolManager.BackFill.FillType = vftGradient then - result := ToolManager.BackFill.Gradient.EndColor - else result := ToolManager.BackColor; + ctForeColorSolid: result := ToolManager.ForeFill.AverageColor; + ctForeColorStartGrad: result := GetStartColor(ToolManager.ForeFill); + ctForeColorEndGrad: result := GetEndColor(ToolManager.ForeFill); + ctBackColorSolid: result := ToolManager.BackFill.AverageColor; + ctBackColorStartGrad: result := GetStartColor(ToolManager.BackFill); + ctBackColorEndGrad: result := GetEndColor(ToolManager.BackFill); + ctOutlineColorSolid: result := ToolManager.OutlineFill.AverageColor; + ctOutlineColorStartGrad: result := GetStartColor(ToolManager.OutlineFill); + ctOutlineColorEndGrad: result := GetEndColor(ToolManager.OutlineFill); else result := BGRAPixelTransparent; end; + if BlackAndWhite then result := BGRAToGrayscale(result); end; procedure TLazPaintCustomInstance.SetColor(ATarget: TColorTarget; AColor: TBGRAPixel); begin + if BlackAndWhite then AColor := BGRAToGrayscale(AColor); case ATarget of ctForeColorSolid: if ToolManager.ForeFill.FillType = vftSolid then ToolManager.ForeColor := AColor; @@ -684,6 +695,12 @@ procedure TLazPaintCustomInstance.SetColor(ATarget: TColorTarget; ToolManager.BackFill.Gradient.StartColor := AColor; ctBackColorEndGrad: if ToolManager.BackFill.FillType = vftGradient then ToolManager.BackFill.Gradient.EndColor := AColor; + ctOutlineColorSolid: if ToolManager.OutlineFill.FillType = vftSolid then + ToolManager.OutlineColor := AColor; + ctOutlineColorStartGrad: if ToolManager.OutlineFill.FillType = vftGradient then + ToolManager.OutlineFill.Gradient.StartColor := AColor; + ctOutlineColorEndGrad: if ToolManager.OutlineFill.FillType = vftGradient then + ToolManager.OutlineFill.Gradient.EndColor := AColor; end; end; diff --git a/lazpaint/maintoolbar.inc b/lazpaint/maintoolbar.inc index 0bc7944e..48d148ff 100644 --- a/lazpaint/maintoolbar.inc +++ b/lazpaint/maintoolbar.inc @@ -1,4 +1,31 @@ procedure TFMain.CreateToolbarElements; + + procedure InitVectorialFill(vf: TLCVectorialFillControl; grad: TBGRALayerGradientOriginal; + lbl: TLabel; pnl: TPanel; mouseMove: TMouseMoveEvent); + begin + vf.PopupMenu := nil; + vf.VerticalPadding:= DoScaleY(6, OriginalDPI); + vf.OnChooseColor := @VectorialFill_ChooseColor; + vf.OnTextureClick := @VectorialFill_TextureClick; + vf.OnFillChange:= @VectorialFill_Change; + vf.AutoSize := False; + vf.OnFillTypeChange:= @VectorialFill_TypeChange; + vf.OnAdjustToShape:= @VectorialFill_AdjustToShape; + vf.OnEditGradTexPoints:= @VectorialFill_EditGradTexPoints; + vf.OnResize:= @VectorialFill_Resize; + with grad do + begin + vf.GradStartColor:= StartColor; + vf.GradEndColor:= EndColor; + vf.GradientType:= GradientType; + vf.GradRepetition:= Repetition; + vf.GradInterpolation:= ColorInterpolation; + end; + if Assigned(lbl) then lbl.OnMouseMove:= mouseMove; + pnl.OnMouseMove:= mouseMove; + vf.OnMouseMove:= mouseMove; + end; + var ps: TPenStyle; begin @@ -8,48 +35,12 @@ begin Panel_ToolbarBackground.PopupMenu := PopupToolbar; Perspective_Repeat.OnClick:=@Perspective_RepeatClick; Perspective_TwoPlanes.OnClick := @Perspective_TwoPlanesClick; - Panel_PenFill.PopupMenu := nil; - Panel_BackFill.PopupMenu := nil; - VectorialFill_Pen.VerticalPadding:= DoScaleY(6, OriginalDPI); - VectorialFill_Back.VerticalPadding:= DoScaleY(6, OriginalDPI); - VectorialFill_Pen.OnChooseColor := @VectorialFill_PenChooseColor; - VectorialFill_Back.OnChooseColor := @VectorialFill_BackChooseColor; - VectorialFill_Pen.OnTextureClick := @VectorialFill_TextureClick; - VectorialFill_Back.OnTextureClick := @VectorialFill_TextureClick; - VectorialFill_Pen.OnFillChange:=@VectorialFill_PenChange; - VectorialFill_Back.OnFillChange:=@VectorialFill_BackChange; - VectorialFill_Pen.AutoSize := False; - VectorialFill_Back.AutoSize := False; - VectorialFill_Pen.OnFillTypeChange:=@VectorialFill_PenTypeChange; - VectorialFill_Back.OnFillTypeChange:=@VectorialFill_BackTypeChange; - VectorialFill_Pen.OnAdjustToShape:=@VectorialFill_PenAdjustToShape; - VectorialFill_Back.OnAdjustToShape:=@VectorialFill_BackAdjustToShape; - VectorialFill_Pen.OnEditGradTexPoints:=@VectorialFill_PenEditGradTexPoints; - VectorialFill_Back.OnEditGradTexPoints:=@VectorialFill_BackEditGradTexPoints; - VectorialFill_Pen.OnResize:=@VectorialFill_PenResize; - VectorialFill_Back.OnResize:=@VectorialFill_BackResize; - with ToolManager.ForeLastGradient do - begin - VectorialFill_Pen.GradStartColor:= StartColor; - VectorialFill_Pen.GradEndColor:= EndColor; - VectorialFill_Pen.GradientType:= GradientType; - VectorialFill_Pen.GradRepetition:= Repetition; - VectorialFill_Pen.GradInterpolation:= ColorInterpolation; - end; - with ToolManager.BackLastGradient do - begin - VectorialFill_Back.GradStartColor:= StartColor; - VectorialFill_Back.GradEndColor:= EndColor; - VectorialFill_Back.GradientType:= GradientType; - VectorialFill_Back.GradRepetition:= Repetition; - VectorialFill_Back.GradInterpolation:= ColorInterpolation; - end; - Label_Pen.OnMouseMove:=@VectorialFill_ShowPenFill; - Panel_PenFill.OnMouseMove:=@VectorialFill_ShowPenFill; - VectorialFill_Pen.OnMouseMove:=@VectorialFill_ShowPenFill; - Label_Back.OnMouseMove:=@VectorialFill_ShowBackFill; - Panel_BackFill.OnMouseMove:=@VectorialFill_ShowBackFill; - VectorialFill_Back.OnMouseMove:=@VectorialFill_ShowBackFill; + InitVectorialFill(VectorialFill_Pen, ToolManager.ForeLastGradient, Label_Pen, Panel_PenFill, @VectorialFill_ShowPenFill); + VectorialFill_Pen.SolidColor := ToolManager.ForeColor; + InitVectorialFill(VectorialFill_Back, ToolManager.BackLastGradient, Label_Back, Panel_BackFill, @VectorialFill_ShowBackFill); + VectorialFill_Back.SolidColor := ToolManager.BackColor; + InitVectorialFill(VectorialFill_Outline, ToolManager.OutlineLastGradient, nil, Panel_OutlineFill, @VectorialFill_ShowOutlineFill); + VectorialFill_Outline.SolidColor := ToolManager.OutlineColor; Image_SwapColors.OnMouseDown := @Image_SwapColorsMouseDown; Tool_DrawShapeBorder.OnClick := @Tool_DrawShapeBorderClick; Tool_Aliasing.OnClick := @Tool_AliasingClick; @@ -319,6 +310,7 @@ begin ToolManager.FillControls.Add(Panel_SwapColor); ToolManager.FillControls.Add(Panel_BackFill); ToolManager.FillControls.Add(Panel_ColorDiff); + ToolManager.OutlineFillControls.Add(Panel_OutlineFill); ToolManager.BrushControls.Add(Panel_Brush); ToolManager.RatioControls.Add(Panel_Ratio); ToolManager.DonateControls.Add(Panel_Donate); @@ -562,10 +554,13 @@ begin UpdateAllowedFillTypes; VectorialFill_Pen.CanAdjustToShape := ToolManager.ToolProvideCommand(tcForeAdjustToShape); VectorialFill_Back.CanAdjustToShape := ToolManager.ToolProvideCommand(tcBackAdjustToShape); + VectorialFill_Outline.CanAdjustToShape := ToolManager.ToolProvideCommand(tcOutlineAdjustToShape); VectorialFill_Pen.CanEditGradTexPoints := ToolManager.ToolProvideCommand(tcForeEditGradTexPoints); VectorialFill_Back.CanEditGradTexPoints := ToolManager.ToolProvideCommand(tcBackEditGradTexPoints); + VectorialFill_Outline.CanEditGradTexPoints := ToolManager.ToolProvideCommand(tcOutlineEditGradTexPoints); VectorialFill_Pen.EditingGradTexPoints := ToolManager.IsForeEditGradTexPoints; VectorialFill_Back.EditingGradTexPoints := ToolManager.IsBackEditGradTexPoints; + VectorialFill_Outline.EditingGradTexPoints := ToolManager.IsOutlineEditGradTexPoints; end; procedure TFMain.QueryArrange; @@ -734,8 +729,10 @@ begin TimerHideFill.Enabled := false; VectorialFill_Pen.Height := VectorialFill_Pen.ToolIconSize + VectorialFill_Pen.VerticalPadding; VectorialFill_Back.Height := VectorialFill_Back.ToolIconSize + VectorialFill_Back.VerticalPadding; + VectorialFill_Outline.Height := VectorialFill_Outline.ToolIconSize + VectorialFill_Outline.VerticalPadding; Panel_PenFill.Height := Panel_SwapColor.Height; Panel_BackFill.Height := Panel_SwapColor.Height; + Panel_OutlineFill.Height := Panel_SwapColor.Height; end; procedure TFMain.ToolButton_DonateClick(Sender: TObject); @@ -818,20 +815,20 @@ begin end; procedure TFMain.UpdateChooseColors; + procedure UpdateFor(AFillControl: TLCVectorialFillControl; ATargetSolid, ATargetStart, ATargetEnd: TColorTarget); + begin + if (AFillControl.FillType = vftSolid) and + (LazPaintInstance.ChooseColorTarget in [ATargetStart, ATargetEnd]) then + LazPaintInstance.ChooseColorTarget := ATargetSolid else + if (AFillControl.FillType = vftGradient) and + (LazPaintInstance.ChooseColorTarget = ATargetSolid) then + LazPaintInstance.ChooseColorTarget := ATargetStart; + end; + begin - if (VectorialFill_Back.FillType = vftSolid) and - (LazPaintInstance.ChooseColorTarget in [ctBackColorStartGrad,ctBackColorEndGrad]) then - LazPaintInstance.ChooseColorTarget := ctBackColorSolid else - if (VectorialFill_Back.FillType = vftGradient) and - (LazPaintInstance.ChooseColorTarget = ctBackColorSolid) then - LazPaintInstance.ChooseColorTarget := ctBackColorStartGrad else - if (VectorialFill_Pen.FillType = vftSolid) and - (LazPaintInstance.ChooseColorTarget in [ctForeColorStartGrad,ctForeColorEndGrad]) then - LazPaintInstance.ChooseColorTarget := ctForeColorSolid else - if (VectorialFill_Pen.FillType = vftGradient) and - (LazPaintInstance.ChooseColorTarget = ctForeColorSolid) then - LazPaintInstance.ChooseColorTarget := ctForeColorStartGrad else - LazPaintInstance.ColorToFChooseColor; + UpdateFor(VectorialFill_Back, ctBackColorSolid, ctBackColorStartGrad, ctBackColorEndGrad); + UpdateFor(VectorialFill_Pen, ctForeColorSolid, ctForeColorStartGrad, ctForeColorEndGrad); + UpdateFor(VectorialFill_Outline, ctOutlineColorSolid, ctOutlineColorStartGrad, ctOutlineColorEndGrad); end; procedure TFMain.UpdateAllowedFillTypes; @@ -902,137 +899,107 @@ begin result := Assigned(ActiveControl) and (ActiveControl.Name = 'EColor'); end; -procedure TFMain.VectorialFill_BackChange(Sender: TObject); -var - tempFill: TVectorialFill; +procedure TFMain.VectorialFill_EditGradTexPoints(Sender: TObject); begin - if FInFillChange then exit; - FInFillChange:= true; - - if ToolManager.BackFill.FillType <> VectorialFill_Back.FillType then - begin - tempFill := TVectorialFill.Create; - VectorialFill_Back.UpdateFillExceptGeometry(tempFill); - tempFill.FitGeometry(ToolManager.SuggestGradientBox); - ToolManager.BackFill.Assign(tempFill); - tempFill.Free; - end else - VectorialFill_Back.UpdateFillExceptGeometry(ToolManager.BackFill); - - UpdateChooseColors; - UpdateEditPicture; - FInFillChange:= false; -end; - -procedure TFMain.VectorialFill_BackEditGradTexPoints(Sender: TObject); -begin - ToolManager.ToolCommand(tcBackEditGradTexPoints); -end; - -procedure TFMain.VectorialFill_BackResize(Sender: TObject); -begin - QueryArrange; + if Sender = VectorialFill_Pen then ToolManager.ToolCommand(tcForeEditGradTexPoints) + else if Sender = VectorialFill_Back then ToolManager.ToolCommand(tcBackEditGradTexPoints) + else if Sender = VectorialFill_Outline then ToolManager.ToolCommand(tcOutlineEditGradTexPoints); end; -procedure TFMain.VectorialFill_BackTypeChange(Sender: TObject); +procedure TFMain.VectorialFill_AdjustToShape(Sender: TObject); begin - DarkThemeInstance.Apply(VectorialFill_Back, DarkTheme); - VectorialFill_Back.Width := VectorialFill_Back.PreferredSize.cx; + if Sender = VectorialFill_Pen then ToolManager.ToolCommand(tcForeAdjustToShape) + else if Sender = VectorialFill_Back then ToolManager.ToolCommand(tcBackAdjustToShape) + else if Sender = VectorialFill_Outline then ToolManager.ToolCommand(tcOutlineAdjustToShape); end; -procedure TFMain.VectorialFill_BackAdjustToShape(Sender: TObject); -begin - ToolManager.ToolCommand(tcBackAdjustToShape); -end; - -procedure TFMain.VectorialFill_PenAdjustToShape(Sender: TObject); -begin - ToolManager.ToolCommand(tcForeAdjustToShape); -end; - -procedure TFMain.VectorialFill_PenChange(Sender: TObject); +procedure TFMain.VectorialFill_Change(Sender: TObject); var - tempFill: TVectorialFill; + tempFill, targetFill: TVectorialFill; + vf: TLCVectorialFillControl; begin if FInFillChange then exit; FInFillChange:= true; + vf := Sender as TLCVectorialFillControl; + if vf = VectorialFill_Pen then targetFill := ToolManager.ForeFill + else if vf = VectorialFill_Back then targetFill := ToolManager.BackFill + else if vf = VectorialFill_Outline then targetFill := ToolManager.OutlineFill + else exit; - if ToolManager.ForeFill.FillType <> VectorialFill_Pen.FillType then + if targetFill.FillType <> vf.FillType then begin tempFill := TVectorialFill.Create; - VectorialFill_Pen.UpdateFillExceptGeometry(tempFill); + vf.UpdateFillExceptGeometry(tempFill); tempFill.FitGeometry(ToolManager.SuggestGradientBox); - ToolManager.ForeFill.Assign(tempFill); + targetFill.Assign(tempFill); tempFill.Free; end else - VectorialFill_Pen.UpdateFillExceptGeometry(ToolManager.ForeFill); + vf.UpdateFillExceptGeometry(targetFill); UpdateChooseColors; UpdateEditPicture; FInFillChange:= false; end; -procedure TFMain.VectorialFill_PenEditGradTexPoints(Sender: TObject); -begin - ToolManager.ToolCommand(tcForeEditGradTexPoints); -end; - -procedure TFMain.VectorialFill_PenResize(Sender: TObject); +procedure TFMain.VectorialFill_Resize(Sender: TObject); begin QueryArrange; end; -procedure TFMain.VectorialFill_PenTypeChange(Sender: TObject); +procedure TFMain.VectorialFill_TypeChange(Sender: TObject); +var + vf: TLCVectorialFillControl; begin - DarkThemeInstance.Apply(VectorialFill_Pen, DarkTheme); - VectorialFill_Pen.Width := VectorialFill_Pen.PreferredSize.cx; + vf := Sender as TLCVectorialFillControl; + DarkThemeInstance.Apply(vf, DarkTheme); + vf.Width := vf.PreferredSize.cx; end; -procedure TFMain.VectorialFill_ShowBackFill(Sender: TObject; - Shift: TShiftState; X, Y: Integer); +procedure TFMain.VectorialFill_ShowBackFill(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin - ShowBackFill; + ShowFill(VectorialFill_Back, Panel_BackFill); end; -procedure TFMain.VectorialFill_ShowPenFill(Sender: TObject; Shift: TShiftState; - X, Y: Integer); +procedure TFMain.VectorialFill_ShowPenFill(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin - ShowPenFill; + ShowFill(VectorialFill_Pen, Panel_PenFill); end; -procedure TFMain.VectorialFill_PenChooseColor(ASender: TObject; AButton: TMouseButton; - AColorIndex: integer; var AColorValue: TBGRAPixel; out AHandled: boolean); -var - target: TColorTarget; +procedure TFMain.VectorialFill_ShowOutlineFill(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin - AHandled := true; - case AColorIndex of - -1: target := ctForeColorSolid; - 0: target := ctForeColorStartGrad; - 1: target := ctForeColorEndGrad; - else exit; - end; - if LazPaintInstance.ChooseColorVisible and (AButton = mbLeft) then - LazPaintInstance.ChooseColorTarget := target - else - begin - if ShowColorDialogFor(target) then - AColorValue := LazPaintInstance.GetColor(target); - end; + ShowFill(VectorialFill_Outline, Panel_OutlineFill); end; -procedure TFMain.VectorialFill_BackChooseColor(ASender: TObject; AButton: TMouseButton; +procedure TFMain.VectorialFill_ChooseColor(ASender: TObject; AButton: TMouseButton; AColorIndex: integer; var AColorValue: TBGRAPixel; out AHandled: boolean); var target: TColorTarget; begin + AHandled := false; + if ASender = VectorialFill_Pen then + case AColorIndex of + -1: target := ctForeColorSolid; + 0: target := ctForeColorStartGrad; + 1: target := ctForeColorEndGrad; + else exit; + end + else if ASender = VectorialFill_Back then + case AColorIndex of + -1: target := ctBackColorSolid; + 0: target := ctBackColorStartGrad; + 1: target := ctBackColorEndGrad; + else exit; + end + else if ASender = VectorialFill_Outline then + case AColorIndex of + -1: target := ctOutlineColorSolid; + 0: target := ctOutlineColorStartGrad; + 1: target := ctOutlineColorEndGrad; + else exit; + end + else exit; + AHandled := true; - case AColorIndex of - -1: target := ctBackColorSolid; - 0: target := ctBackColorStartGrad; - 1: target := ctBackColorEndGrad; - else exit; - end; if LazPaintInstance.ChooseColorVisible and (AButton = mbLeft) then LazPaintInstance.ChooseColorTarget := target else @@ -1495,19 +1462,11 @@ begin end; end; -procedure TFMain.ShowPenFill; -begin - VectorialFill_Pen.BringToFront; - VectorialFill_Pen.Height := VectorialFill_Pen.PreferredSize.cy; - Panel_PenFill.Height := VectorialFill_Pen.Top+VectorialFill_Pen.Height+DoScaleY(3, OriginalDPI); - HideFill(3000, true); -end; - -procedure TFMain.ShowBackFill; +procedure TFMain.ShowFill(AFillControl: TLCVectorialFillControl; APanel: TPanel); begin - VectorialFill_Back.BringToFront; - VectorialFill_Back.Height := VectorialFill_Back.PreferredSize.cy; - Panel_BackFill.Height := VectorialFill_Back.Top+VectorialFill_Back.height+DoScaleY(3, OriginalDPI); + AFillControl.BringToFront; + AFillControl.Height := AFillControl.PreferredSize.cy; + APanel.Height := AFillControl.Top + AFillControl.Height + DoScaleY(3, OriginalDPI); HideFill(3000, true); end; diff --git a/lazpaint/tools/utool.pas b/lazpaint/tools/utool.pas index 39cbcbb4..3f2be77e 100644 --- a/lazpaint/tools/utool.pas +++ b/lazpaint/tools/utool.pas @@ -35,9 +35,10 @@ interface 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 @@ TToolManager = class; 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 @@ TGenericTool = class 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 @@ TGenericTool = class 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 } @@ -195,8 +201,8 @@ TToolManager = class 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 +258,11 @@ TToolManager = class 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 +270,19 @@ TToolManager = class 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 +306,18 @@ TToolManager = class 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 +340,7 @@ TToolManager = class 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 +359,10 @@ TToolManager = class 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 +376,9 @@ TToolManager = class 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 +412,7 @@ TToolManager = class 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,7 +442,7 @@ TToolManager = class ShapeControls, PenStyleControls, JoinStyleControls, SplineStyleControls, CloseShapeControls, LineCapControls, DeformationControls, TextControls, TextShadowControls, PhongControls, AltitudeControls, - PerspectiveControls,FillControls, + PerspectiveControls,FillControls,OutlineFillControls, BrushControls, RatioControls, DonateControls: TList; constructor Create(AImage: TLazPaintImage; AConfigProvider: IConfigProvider; @@ -466,6 +488,7 @@ TToolManager = class function DisplayFilledSelection: boolean; function IsForeEditGradTexPoints: boolean; function IsBackEditGradTexPoints: boolean; + function IsOutlineEditGradTexPoints: boolean; procedure QueryExitTool; procedure RenderTool(formBitmap: TBGRABitmap); @@ -495,10 +518,14 @@ TToolManager = class 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; @@ -793,11 +820,21 @@ function TGenericTool.GetAllowedForeFillTypes: TVectorialFillTypes; 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; @@ -1366,6 +1403,11 @@ procedure TToolManager.SetLineCap(AValue: TPenEndCap); 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; @@ -1612,16 +1654,26 @@ function TToolManager.GetCursor: TCursor; 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; @@ -1637,6 +1689,12 @@ function TToolManager.GetAllowedForeFillTypes: TVectorialFillTypes; 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 @@ -1651,6 +1709,14 @@ function TToolManager.GetMaxDeformationGridSize: TSize; 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; @@ -1682,19 +1748,6 @@ function TToolManager.GetTextFontStyle: TFontStyles; 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; @@ -1725,6 +1778,12 @@ function TToolManager.ScriptGetBackColor(AVars: TVariableSet): TScriptResult; 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; @@ -1898,6 +1957,26 @@ function TToolManager.ScriptGetForeGradientColors(AVars: TVariableSet): TScriptR 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 @@ -1941,6 +2020,16 @@ function TToolManager.ScriptGetForeTextureOpacity(AVars: TVariableSet): TScriptR 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; @@ -2159,6 +2248,12 @@ function TToolManager.ScriptSetBackColor(AVars: TVariableSet): TScriptResult; 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; @@ -2311,8 +2406,8 @@ function TToolManager.ScriptSetGradientType(AVars: TVariableSet; AFill: TVectori 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; @@ -2344,8 +2439,8 @@ function TToolManager.ScriptSetGradientColors(AVars: TVariableSet; 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; @@ -2381,6 +2476,26 @@ function TToolManager.ScriptSetBackGradientColors(AVars: TVariableSet): TScriptR 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); @@ -2474,6 +2589,21 @@ function TToolManager.ScriptSetForeTextureOpacity(AVars: TVariableSet): TScriptR 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; @@ -2714,15 +2844,24 @@ constructor TToolManager.Create(AImage: TLazPaintImage; AConfigProvider: IConfig FForeFill := TVectorialFill.Create; FForeFill.TransparentMode := tmAlphaZeroOnly; FForeFill.SolidColor := BGRABlack; - FForeFill.OnChange:=@ForeFillChange; + FForeFill.OnChange:= @FillChange; + FForeLastGradient:= TBGRALayerGradientOriginal.Create; + FForeLastGradient.ColorInterpolation:= ciLinearRGB; + FBackFill := TVectorialFill.Create; FBackFill.TransparentMode := tmAlphaZeroOnly; FBackFill.SolidColor := CSSSkyBlue; - FBackFill.OnChange:=@BackFillChange; - FForeLastGradient:= TBGRALayerGradientOriginal.Create; - FForeLastGradient.ColorInterpolation:= ciLinearRGB; + 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; @@ -2776,6 +2915,7 @@ constructor TToolManager.Create(AImage: TLazPaintImage; AConfigProvider: IConfig AltitudeControls := TList.Create; PerspectiveControls := TList.Create; FillControls := TList.Create; + OutlineFillControls := TList.Create; BrushControls := TList.Create; RatioControls := TList.Create; DonateControls := TList.Create; @@ -2808,6 +2948,7 @@ destructor TToolManager.Destroy; AltitudeControls.Free; PerspectiveControls.Free; FillControls.Free; + OutlineFillControls.Free; BrushControls.Free; RatioControls.Free; DonateControls.Free; @@ -2818,8 +2959,10 @@ destructor TToolManager.Destroy; FForeFill.Free; FBackFill.Free; + FOutlineFill.Free; FForeLastGradient.Free; FBackLastGradient.Free; + FOutlineLastGradient.Free; RegisterScriptFunctions(False); inherited Destroy; @@ -2836,8 +2979,10 @@ procedure TToolManager.LoadFromConfig; 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); @@ -2874,8 +3019,10 @@ procedure TToolManager.SaveToConfig; 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); @@ -3051,7 +3198,13 @@ function TToolManager.UpdateContextualToolbars: boolean; 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)); @@ -3090,6 +3243,8 @@ procedure TToolManager.RegisterScriptFunctions(ARegister: boolean); 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); @@ -3153,6 +3308,14 @@ procedure TToolManager.RegisterScriptFunctions(ARegister: boolean); 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); @@ -3163,6 +3326,11 @@ procedure TToolManager.RegisterScriptFunctions(ARegister: boolean); 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); @@ -3586,6 +3754,12 @@ function TToolManager.IsBackEditGradTexPoints: boolean; 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; diff --git a/lazpaint/tools/utooltext.pas b/lazpaint/tools/utooltext.pas index 5d0f37cc..3888dce1 100644 --- a/lazpaint/tools/utooltext.pas +++ b/lazpaint/tools/utooltext.pas @@ -28,10 +28,6 @@ TToolText = class(TVectorialTool) procedure AssignShapeStyle(AMatrix: TAffineMatrix; AAlwaysFit: boolean); override; procedure QuickDefineEnd; override; function RoundCoordinate(constref ptF: TPointF): TPointF; override; - function ForeGradTexMode: TVectorShapeUsermode; override; - function BackGradTexMode: TVectorShapeUsermode; override; - function ShapeForeFill: TVectorialFill; override; - function ShapeBackFill: TVectorialFill; override; function DoToolKeyDown(var key: Word): TRect; override; public constructor Create(AManager: TToolManager); override; @@ -150,9 +146,8 @@ procedure TToolText.AssignShapeStyle(AMatrix: TAffineMatrix; AAlwaysFit: boolean r: TRect; toolDest: TBGRABitmap; zoom: Single; - gradBox: TAffineBox; - fitMode: TFitMode; begin + inherited AssignShapeStyle(AMatrix, AAlwaysFit); FMatrix := AMatrix; with TTextShape(FShape) do begin @@ -161,27 +156,6 @@ procedure TToolText.AssignShapeStyle(AMatrix: TAffineMatrix; AAlwaysFit: boolean FontName:= Manager.TextFontName; FontStyle:= Manager.TextFontStyle; Aliased := Manager.ShapeOptionAliasing; - gradBox := self.SuggestGradientBox; - - if AAlwaysFit then fitMode := fmAlways else fitMode := ForeFitMode; - if FSwapColor then - AssignFill(FShape.PenFill, Manager.BackFill, gradBox, fitMode) - else - AssignFill(FShape.PenFill, Manager.ForeFill, gradBox, fitMode); - - if Manager.TextOutline and (Manager.TextOutlineWidth>0) and - (Manager.BackColor.alpha > 0) then - begin - if AAlwaysFit then fitMode := fmAlways else fitMode := BackFitMode; - if FSwapColor then - AssignFill(FShape.OutlineFill, Manager.ForeFill, gradBox, fitMode) - else - AssignFill(FShape.OutlineFill, Manager.BackFill, gradBox, fitMode); - OutlineWidth := Manager.TextOutlineWidth; - end - else - OutlineFill.Clear; - LightPosition := AMatrix*Manager.LightPosition; AltitudePercent:= Manager.PhongShapeAltitude; ParagraphAlignment:= Manager.TextAlign; @@ -207,38 +181,6 @@ function TToolText.RoundCoordinate(constref ptF: TPointF): TPointF; result := PointF(floor(ptF.x)+0.5,floor(ptF.y)+0.5); end; -function TToolText.ForeGradTexMode: TVectorShapeUsermode; -begin - if FSwapColor then result := vsuEditOutlineFill else - result := vsuEditPenFill; -end; - -function TToolText.BackGradTexMode: TVectorShapeUsermode; -begin - if FSwapColor then result := vsuEditPenFill else - result := vsuEditOutlineFill; -end; - -function TToolText.ShapeForeFill: TVectorialFill; -begin - if Assigned(FShape) then - begin - if FSwapColor then result := FShape.OutlineFill else - result := FShape.PenFill; - end else - result := nil; -end; - -function TToolText.ShapeBackFill: TVectorialFill; -begin - if Assigned(FShape) then - begin - if FSwapColor then result := FShape.PenFill else - result := FShape.OutlineFill; - end else - result := nil; -end; - constructor TToolText.Create(AManager: TToolManager); begin inherited Create(AManager); @@ -247,7 +189,7 @@ constructor TToolText.Create(AManager: TToolManager); function TToolText.GetContextualToolbars: TContextualToolbars; begin - Result:= [ctPenFill,ctBackFill,ctText,ctAliasing]; + Result:= [ctPenFill,ctText,ctOutlineFill,ctOutlineWidth,ctAliasing]; if Manager.TextPhong then include(result, ctAltitude); end; diff --git a/lazpaint/tools/utoolvectorial.pas b/lazpaint/tools/utoolvectorial.pas index 3c8a65f8..5cdbac72 100644 --- a/lazpaint/tools/utoolvectorial.pas +++ b/lazpaint/tools/utoolvectorial.pas @@ -72,12 +72,16 @@ TVectorialTool = class(TGenericTool) procedure ShapeValidated; virtual; function ForeGradTexMode: TVectorShapeUsermode; virtual; function BackGradTexMode: TVectorShapeUsermode; virtual; - function ShapeForeFill: TVectorialFill; virtual; - function ShapeBackFill: TVectorialFill; virtual; + function OutlineGradTexMode: TVectorShapeUsermode; virtual; function ForeFitMode: TFitMode; function BackFitMode: TFitMode; + function OutlineFitMode: TFitMode; + function ManagerForeFill: TVectorialFill; + function ManagerBackFill: TVectorialFill; + function ManagerOutlineFill: TVectorialFill; function GetIsForeEditGradTexPoints: boolean; override; function GetIsBackEditGradTexPoints: boolean; override; + function GetIsOutlineEditGradTexPoints: boolean; override; function GetGridMatrix: TAffineMatrix; virtual; property Editor: TBGRAOriginalEditor read GetEditor; public @@ -145,12 +149,13 @@ TEditShapeTool = class(TGenericTool) function InvalidEditMode: boolean; function ForeGradTexMode: TVectorShapeUsermode; virtual; function BackGradTexMode: TVectorShapeUsermode; virtual; - function ShapeForeFill: TVectorialFill; virtual; - function ShapeBackFill: TVectorialFill; virtual; + function OutlineGradTexMode: TVectorShapeUsermode; virtual; function ForeFitMode: TFitMode; function BackFitMode: TFitMode; + function OutlineFitMode: TFitMode; function GetIsForeEditGradTexPoints: boolean; override; function GetIsBackEditGradTexPoints: boolean; override; + function GetIsOutlineEditGradTexPoints: boolean; override; function GetAllowedBackFillTypes: TVectorialFillTypes; override; function GetStatusText: string; override; public @@ -376,45 +381,35 @@ procedure TEditShapeTool.UpdateToolManagerFromShape(AShape: TVectorShape); zoom: single; m: TAffineMatrix; doFill, doDraw: Boolean; + f: TVectorShapeFields; begin m := Manager.Image.LayerOriginalMatrix[Manager.Image.CurrentLayerIndex]; zoom := (VectLen(m[1,1],m[2,1])+VectLen(m[1,2],m[2,2]))/2; if AShape.Usermode in [vsuEditBackFill, vsuEditPenFill] then AShape.Usermode := vsuEdit; opt := Manager.ShapeOptions; - if AShape.Fields*[vsfPenFill,vsfBackFill,vsfPenStyle] = [vsfPenFill,vsfBackFill,vsfPenStyle] then - begin - if AShape.BackFill.FillType = vftNone then - begin; - exclude(opt,toFillShape); - doFill := false; - end - else - begin - include(opt,toFillShape); - doFill := true; - end; - ps := BGRAToPenStyle(AShape.PenStyle); - if (ps = psClear) or (AShape.PenFill.FillType = vftNone) then - begin - exclude(opt,toDrawShape); - doDraw := false; - end - else - begin - include(opt,toDrawShape); - Manager.PenStyle := ps; - doDraw := true; - end; - end else + f := AShape.Fields; + doDraw := vsfPenFill in f; + doFill := vsfBackFill in f; + if vsfPenStyle in f then begin - doDraw := vsfPenFill in AShape.Fields; - doFill := vsfBackFill in AShape.Fields; + doDraw := AShape.PenVisible; + if doDraw then doFill := AShape.BackVisible; + + if not doFill then + exclude(opt,toFillShape) + else include(opt,toFillShape); + if not doDraw then + exclude(opt,toDrawShape) + else + begin + include(opt,toDrawShape); + Manager.PenStyle := ps; + end; end; - if doDraw then begin - if AShape.PenFill.FillType = vftNone then + if not AShape.PenVisible then Manager.ForeColor := BGRA(Manager.ForeColor.red, Manager.ForeColor.green,Manager.ForeColor.blue,0) else @@ -422,17 +417,23 @@ procedure TEditShapeTool.UpdateToolManagerFromShape(AShape: TVectorShape); end; if doFill then begin - if AShape.BackFill.FillType = vftNone then + if not AShape.BackVisible then Manager.BackColor := BGRA(Manager.BackColor.red, Manager.BackColor.green,Manager.BackColor.blue,0) else Manager.BackFill.Assign(AShape.BackFill); end; + if not AShape.OutlineVisible then + Manager.SetTextOutline(false, Manager.TextOutlineWidth) else + begin + Manager.SetTextOutline(true, AShape.OutlineWidth*zoom); + Manager.OutlineFill.Assign(AShape.OutlineFill); + end; if toDrawShape in opt then begin - if vsfPenWidth in AShape.Fields then Manager.PenWidth := AShape.PenWidth*zoom; - if vsfJoinStyle in AShape.Fields then Manager.JoinStyle:= AShape.JoinStyle; + if vsfPenWidth in f then Manager.PenWidth := AShape.PenWidth*zoom; + if vsfJoinStyle in f then Manager.JoinStyle:= AShape.JoinStyle; if AShape is TCustomPolypointShape then begin if TCustomPolypointShape(AShape).Closed then @@ -455,14 +456,8 @@ procedure TEditShapeTool.UpdateToolManagerFromShape(AShape: TVectorShape); Manager.LightPosition := m*LightPosition; Manager.PhongShapeAltitude := round(AltitudePercent); Manager.TextAlign:= ParagraphAlignment; - Manager.SetTextFont(FontName,round(FontEmHeight*zoom*72/Manager.Image.DPI),FontStyle); + Manager.SetTextFont(FontName, FontEmHeight*zoom*72/Manager.Image.DPI, FontStyle); Manager.TextShadow:= false; - if OutlineFill.FillType = vftNone then - Manager.SetTextOutline(false, Manager.TextOutlineWidth) else - begin - Manager.SetTextOutline(true, OutlineWidth); - Manager.BackFill.Assign(OutlineFill); - end; if Aliased then include(opt,toAliasing) else exclude(opt,toAliasing); @@ -606,52 +601,64 @@ function TEditShapeTool.DoToolUpdate(toolDest: TBGRABitmap): TRect; m: TAffineMatrix; zoom: Single; gradBox: TAffineBox; + f: TVectorShapeFields; + shape: TVectorShape; begin + shape := nil; case GetEditMode of esmShape: - with GetVectorOriginal do try BindOriginalEvent(true); - gradBox := SelectedShape.SuggestGradientBox(AffineMatrixIdentity); + shape := GetVectorOriginal.SelectedShape; + shape.BeginUpdate; + gradBox := shape.SuggestGradientBox(AffineMatrixIdentity); m := AffineMatrixInverse(Manager.Image.LayerOriginalMatrix[Manager.Image.CurrentLayerIndex]); zoom := (VectLen(m[1,1],m[2,1])+VectLen(m[1,2],m[2,2]))/2; - if SelectedShape.Fields*[vsfPenFill,vsfBackFill,vsfPenStyle] = [vsfPenFill,vsfBackFill,vsfPenStyle] then + f := shape.Fields; + if f*[vsfPenFill,vsfBackFill,vsfPenStyle] = [vsfPenFill,vsfBackFill,vsfPenStyle] then begin doDraw := toDrawShape in Manager.ShapeOptions; doFill := toFillShape in Manager.ShapeOptions; if doDraw then - SelectedShape.PenStyle := PenStyleToBGRA(Manager.PenStyle) + shape.PenStyle := PenStyleToBGRA(Manager.PenStyle) else - SelectedShape.PenStyle := ClearPenStyle; + shape.PenStyle := ClearPenStyle; - if vsfPenWidth in SelectedShape.Fields then SelectedShape.PenWidth := Manager.PenWidth*zoom; - if vsfJoinStyle in SelectedShape.Fields then SelectedShape.JoinStyle := Manager.JoinStyle; - if SelectedShape is TCustomPolypointShape then + if doDraw and (vsfPenWidth in f) then shape.PenWidth := Manager.PenWidth*zoom; + if doDraw and (vsfJoinStyle in f) then shape.JoinStyle := Manager.JoinStyle; + if shape is TCustomPolypointShape then begin - TCustomPolypointShape(SelectedShape).Closed := toCloseShape in Manager.ShapeOptions; - if not TCustomPolypointShape(SelectedShape).Closed then + TCustomPolypointShape(shape).Closed := toCloseShape in Manager.ShapeOptions; + if not TCustomPolypointShape(shape).Closed then begin - TCustomPolypointShape(SelectedShape).LineCap:= Manager.LineCap; - TCustomPolypointShape(SelectedShape).ArrowSize:= Manager.ArrowSize; - TCustomPolypointShape(SelectedShape).ArrowStartKind:= Manager.ArrowStart; - TCustomPolypointShape(SelectedShape).ArrowEndKind:= Manager.ArrowEnd; + TCustomPolypointShape(shape).LineCap:= Manager.LineCap; + TCustomPolypointShape(shape).ArrowSize:= Manager.ArrowSize; + TCustomPolypointShape(shape).ArrowStartKind:= Manager.ArrowStart; + TCustomPolypointShape(shape).ArrowEndKind:= Manager.ArrowEnd; end; end; - if SelectedShape is TCurveShape then - TCurveShape(SelectedShape).SplineStyle:= Manager.SplineStyle; + if shape is TCurveShape then + TCurveShape(shape).SplineStyle:= Manager.SplineStyle; end else begin - doDraw := vsfPenFill in SelectedShape.Fields; - doFill := vsfBackFill in SelectedShape.Fields; + doDraw := vsfPenFill in f; + doFill := vsfBackFill in f; + end; + if doFill then AssignFill(shape.BackFill, Manager.BackFill, gradBox, BackFitMode) + else if vsfBackFill in f then + shape.BackFill.Clear; + if doDraw then AssignFill(shape.PenFill, Manager.ForeFill, gradBox, ForeFitMode); + if (vsfOutlineWidth in f) and Manager.TextOutline then shape.OutlineWidth := Manager.TextOutlineWidth*zoom; + if vsfOutlineFill in f then + begin + if Manager.TextOutline then + AssignFill(shape.OutLineFill, Manager.OutLineFill, gradBox, OutlineFitMode) + else shape.OutlineFill.Clear; end; - if doFill then AssignFill(SelectedShape.BackFill, Manager.BackFill, gradBox, BackFitMode) - else if vsfBackFill in SelectedShape.Fields then - SelectedShape.BackFill.Clear; - if doDraw then AssignFill(SelectedShape.PenFill, Manager.ForeFill, gradBox, ForeFitMode); - if SelectedShape is TTextShape then - with TTextShape(SelectedShape) do + if shape is TTextShape then + with TTextShape(shape) do begin PenPhong := Manager.TextPhong; LightPosition := m*Manager.LightPosition; @@ -660,16 +667,10 @@ function TEditShapeTool.DoToolUpdate(toolDest: TBGRABitmap): TRect; FontName:= Manager.TextFontName; FontEmHeight:= Manager.TextFontSize*zoom*Manager.Image.DPI/72; FontStyle := Manager.TextFontStyle; - if Manager.TextOutline then - begin - OutlineWidth := Manager.TextOutlineWidth; - AssignFill(OutLineFill, Manager.BackFill, gradBox, BackFitMode); - end else - OutlineFill.Clear; Aliased := Manager.ShapeOptionAliasing; end; - if SelectedShape is TPhongShape then - with TPhongShape(SelectedShape) do + if shape is TPhongShape then + with TPhongShape(shape) do begin ShapeKind := Manager.PhongShapeKind; LightPosition := Manager.LightPosition; @@ -677,6 +678,7 @@ function TEditShapeTool.DoToolUpdate(toolDest: TBGRABitmap): TRect; BorderSizePercent := Manager.PhongShapeBorderSize; end; finally + if Assigned(shape) then shape.EndUpdate; BindOriginalEvent(false); end; esmGradient: @@ -725,7 +727,7 @@ procedure TEditShapeTool.StopEdit(AUpdateInterface, ARaiseToolUp: boolean); Manager.Image.LayerMayChange(GetToolDrawingLayer,r); end; case GetEditMode of - esmShape: GetVectorOriginal.DeselectShape; + esmShape: GetVectorOriginal.DeselectShapes; esmGradient: FIsEditingGradient:= false; esmOtherOriginal: FreeAndNil(FOriginalRect); esmSelection: FreeAndNil(FSelectionRect); @@ -866,23 +868,38 @@ function TEditShapeTool.FixLayerOffset: boolean; destructor TEditShapeTool.Destroy; begin - StopEdit(False, False); + FreeAndNil(FOriginalRect); + FreeAndNil(FSelectionRect); + Manager.Image.CurrentState.LayeredBitmap.ClearEditor; + FreeAndNil(FRectEditor); inherited Destroy; end; function TEditShapeTool.GetContextualToolbars: TContextualToolbars; var shape: TVectorShape; + f: TVectorShapeFields; begin Result:= [ctPenFill, ctBackFill]; case GetEditMode of esmShape: begin shape := GetVectorOriginal.SelectedShape; - if shape is TRectShape then result := result + [ctShape,ctPenWidth,ctPenStyle,ctJoinStyle] - else if shape is TEllipseShape then result := result + [ctShape,ctPenWidth,ctPenStyle] - else if shape is TCurveShape then result := result + [ctShape,ctCloseShape,ctPenWidth,ctPenStyle,ctLineCap,ctSplineStyle] - else if shape is TPolylineShape then result := result + [ctShape,ctCloseShape,ctPenWidth,ctPenStyle,ctJoinStyle,ctLineCap] + + f := shape.Fields; + if vsfPenWidth in f then result += [ctPenWidth]; + if vsfPenStyle in f then result += [ctPenStyle]; + if vsfJoinStyle in f then result += [ctJoinStyle]; + if [vsfPenStyle,vsfPenFill,vsfBackFill] <= f then result += [ctShape]; + if vsfOutlineFill in f then + begin + result += [ctOutlineFill]; + if not (vsfBackFill in f) then result -= [ctBackFill]; + end; + if vsfOutlineWidth in f then result += [ctOutlineWidth]; + + if shape is TCurveShape then result := result + [ctShape,ctCloseShape,ctLineCap,ctSplineStyle] + else if shape is TPolylineShape then result := result + [ctShape,ctCloseShape,ctLineCap] else if shape is TPhongShape then result := result + [ctPhong,ctAltitude] else if shape is TTextShape then begin @@ -1010,7 +1027,7 @@ function TEditShapeTool.ConvertToSpline: boolean; shapeAfter := TCurveShape.CreateFrom(orig, shapeBefore); shapeAfter.JoinStyle := pjsRound; orig.ReplaceShape(orig.IndexOfShape(shapeBefore), shapeAfter); - orig.SelectShape(shapeAfter); + orig.SelectShape(shapeAfter, False); result := true; end else result := false; @@ -1050,28 +1067,12 @@ function TEditShapeTool.ForeGradTexMode: TVectorShapeUsermode; function TEditShapeTool.BackGradTexMode: TVectorShapeUsermode; begin - if (GetEditMode = esmShape) and (GetVectorOriginal.SelectedShape is TTextShape) then - result := vsuEditOutlineFill - else - result := vsuEditBackFill; -end; - -function TEditShapeTool.ShapeForeFill: TVectorialFill; -begin - if GetEditMode = esmShape then result := GetVectorOriginal.SelectedShape.PenFill - else result := nil; + result := vsuEditBackFill; end; -function TEditShapeTool.ShapeBackFill: TVectorialFill; +function TEditShapeTool.OutlineGradTexMode: TVectorShapeUsermode; begin - if GetEditMode = esmShape then - begin - if GetVectorOriginal.SelectedShape is TTextShape then - result := GetVectorOriginal.SelectedShape.OutlineFill - else - result := GetVectorOriginal.SelectedShape.BackFill; - end - else result := nil; + result := vsuEditOutlineFill; end; function TEditShapeTool.ForeFitMode: TFitMode; @@ -1086,6 +1087,12 @@ function TEditShapeTool.BackFitMode: TFitMode; else result := fmIfChange; end; +function TEditShapeTool.OutlineFitMode: TFitMode; +begin + if IsOutlineEditGradTexPoints then result := fmNever + else result := fmIfChange; +end; + function TEditShapeTool.GetIsForeEditGradTexPoints: boolean; begin result := (GetEditMode = esmShape) and (GetVectorOriginal.SelectedShape.Usermode = ForeGradTexMode); @@ -1096,6 +1103,11 @@ function TEditShapeTool.GetIsBackEditGradTexPoints: boolean; result := (GetEditMode = esmShape) and (GetVectorOriginal.SelectedShape.Usermode = BackGradTexMode); end; +function TEditShapeTool.GetIsOutlineEditGradTexPoints: boolean; +begin + result := (GetEditMode = esmShape) and (GetVectorOriginal.SelectedShape.Usermode = OutlineGradTexMode); +end; + function TEditShapeTool.GetAllowedBackFillTypes: TVectorialFillTypes; begin if GetEditMode = esmGradient then @@ -1134,7 +1146,7 @@ constructor TEditShapeTool.Create(AManager: TToolManager); if not Manager.Image.SelectionMaskEmpty then begin if (GetCurrentLayerKind = lkVectorial) and Assigned(GetVectorOriginal.SelectedShape) then - GetVectorOriginal.DeselectShape; + GetVectorOriginal.DeselectShapes; DoEditSelection; end else if (GetCurrentLayerKind = lkVectorial) and Assigned(GetVectorOriginal.SelectedShape) then @@ -1309,7 +1321,7 @@ function TEditShapeTool.ToolUp: TRect; zoom := (VectLen(m[1,1],m[2,1])+VectLen(m[1,2],m[2,2]))/2/Manager.Image.ZoomFactor; BindOriginalEvent(true); try - if GetVectorOriginal.MouseClick(m*FLastPos, DoScaleX(PointSize, OriginalDPI)*zoom) then + if GetVectorOriginal.MouseClick(m*FLastPos, DoScaleX(PointSize, OriginalDPI)*zoom, ssShift in ShiftState) then begin handled := true; result := OnlyRenderChange; @@ -1423,8 +1435,9 @@ function TEditShapeTool.ToolCommand(ACommand: TToolCommand): boolean; tcBackEditGradTexPoints: if GetVectorOriginal.SelectedShape.Usermode = BackGradTexMode then GetVectorOriginal.SelectedShape.Usermode := vsuEdit else GetVectorOriginal.SelectedShape.Usermode := BackGradTexMode; - tcForeAdjustToShape: ShapeForeFill.FitGeometry(SuggestGradientBox); - tcBackAdjustToShape: ShapeBackFill.FitGeometry(SuggestGradientBox); + tcForeAdjustToShape: GetVectorOriginal.SelectedShape.PenFill.FitGeometry(SuggestGradientBox); + tcBackAdjustToShape: GetVectorOriginal.SelectedShape.BackFill.FitGeometry(SuggestGradientBox); + tcOutlineAdjustToShape: GetVectorOriginal.SelectedShape.OutlineFill.FitGeometry(SuggestGradientBox); tcShapeToSpline: result := ConvertToSpline; else result := false; end; @@ -1512,7 +1525,7 @@ function TEditShapeTool.ToolProvideCommand(ACommand: TToolCommand): boolean; begin case ACommand of tcCut,tcCopy,tcDelete: result:= GetEditMode in [esmShape,esmOtherOriginal,esmGradient]; - tcForeAdjustToShape: result := GetEditMode = esmShape; + tcForeAdjustToShape,tcOutlineAdjustToShape: result := GetEditMode = esmShape; tcBackAdjustToShape: result := GetEditMode in [esmShape,esmGradient]; tcForeEditGradTexPoints: result := (GetEditMode = esmShape) and (ForeGradTexMode in GetVectorOriginal.SelectedShape.Usermodes); @@ -1652,34 +1665,32 @@ procedure TVectorialTool.ShapeValidated; function TVectorialTool.ForeGradTexMode: TVectorShapeUsermode; begin - if FSwapColor then result := vsuEditBackFill else + if Assigned(FShape) and FSwapColor then + begin + if vsfBackFill in FShape.Fields then + result := vsuEditBackFill + else if vsfOutlineFill in FShape.Fields then + result := vsuEditOutlineFill + else + result := vsuEditPenFill; + end else result := vsuEditPenFill; end; function TVectorialTool.BackGradTexMode: TVectorShapeUsermode; begin - if FSwapColor then result := vsuEditPenFill else + if Assigned(FShape) and FSwapColor and (vsfPenFill in FShape.Fields) then + result := vsuEditPenFill + else result := vsuEditBackFill; end; -function TVectorialTool.ShapeForeFill: TVectorialFill; -begin - if Assigned(FShape) then - begin - if FSwapColor then result := FShape.BackFill else - result := FShape.PenFill; - end else - result := nil; -end; - -function TVectorialTool.ShapeBackFill: TVectorialFill; +function TVectorialTool.OutlineGradTexMode: TVectorShapeUsermode; begin - if Assigned(FShape) then - begin - if FSwapColor then result := FShape.PenFill else - result := FShape.BackFill; - end else - result := nil; + if Assigned(FShape) and FSwapColor and ([vsfPenFill,vsfBackFill]*FShape.Fields = [vsfPenFill]) then + result := vsuEditPenFill + else + result := vsuEditOutlineFill; end; function TVectorialTool.ForeFitMode: TFitMode; @@ -1693,6 +1704,42 @@ function TVectorialTool.BackFitMode: TFitMode; if IsBackEditGradTexPoints then result := fmNever else result := fmIfChange; end; + +function TVectorialTool.OutlineFitMode: TFitMode; +begin + if IsOutlineEditGradTexPoints then result := fmNever + else result := fmIfChange; +end; + +function TVectorialTool.ManagerForeFill: TVectorialFill; +begin + if Assigned(FShape) and FSwapColor then + begin + if vsfBackFill in FShape.Fields then + result := Manager.BackFill + else if vsfOutlineFill in FShape.Fields then + result := Manager.OutlineFill + else + result := Manager.ForeFill; + end else + result := Manager.ForeFill; +end; + +function TVectorialTool.ManagerBackFill: TVectorialFill; +begin + if Assigned(FShape) and FSwapColor and (vsfPenFill in FShape.Fields) then + result := Manager.ForeFill + else + result := Manager.BackFill; +end; + +function TVectorialTool.ManagerOutlineFill: TVectorialFill; +begin + if Assigned(FShape) and FSwapColor and ([vsfPenFill,vsfBackFill]*FShape.Fields = [vsfPenFill]) then + result := Manager.ForeFill + else + result := Manager.OutlineFill; +end; function TVectorialTool.GetIsForeEditGradTexPoints: boolean; begin @@ -1704,6 +1751,11 @@ function TVectorialTool.GetIsBackEditGradTexPoints: boolean; result := Assigned(FShape) and (FShape.Usermode = BackGradTexMode); end; +function TVectorialTool.GetIsOutlineEditGradTexPoints: boolean; +begin + result := Assigned(FShape) and (FShape.Usermode = OutlineGradTexMode); +end; + function TVectorialTool.GetGridMatrix: TAffineMatrix; begin if Manager.Image.ZoomFactor > DoScaleX(35, OriginalDPI)/10 then @@ -1825,17 +1877,14 @@ procedure TVectorialTool.AssignShapeStyle(AMatrix: TAffineMatrix; AAlwaysFit: bo fitMode: TFitMode; begin zoom := (VectLen(AMatrix[1,1],AMatrix[2,1])+VectLen(AMatrix[1,2],AMatrix[2,2]))/2; - f:= FShape.Fields; + f := FShape.Fields; gradBox := FShape.SuggestGradientBox(AffineMatrixIdentity); if vsfPenFill in f then begin if HasPen then begin if AAlwaysFit then fitMode := fmAlways else fitMode := ForeFitMode; - if FSwapColor then - AssignFill(FShape.PenFill, Manager.BackFill, gradBox, fitMode) - else - AssignFill(FShape.PenFill, Manager.ForeFill, gradBox, fitMode); + AssignFill(FShape.PenFill, ManagerForeFill, gradBox, fitMode) end else FShape.PenFill.Clear; end; @@ -1847,13 +1896,21 @@ procedure TVectorialTool.AssignShapeStyle(AMatrix: TAffineMatrix; AAlwaysFit: bo if HasBrush then begin if AAlwaysFit then fitMode := fmAlways else fitMode := BackFitMode; - if FSwapColor then - AssignFill(FShape.BackFill, Manager.ForeFill, gradBox, fitMode) - else - AssignFill(FShape.BackFill, Manager.BackFill, gradBox, fitMode); + AssignFill(FShape.BackFill, ManagerBackFill, gradBox, fitMode) end else FShape.BackFill.Clear; end; + if vsfOutlineFill in f then + begin + if Manager.TextOutline then + begin + if AAlwaysFit then fitMode := fmAlways else fitMode := OutlineFitMode; + AssignFill(FShape.OutlineFill, ManagerOutlineFill, gradBox, fitMode); + end else + FShape.OutlineFill.Clear; + end; + if (vsfOutlineWidth in f) and Manager.TextOutline then + FShape.OutlineWidth := zoom*Manager.TextOutlineWidth; end; function TVectorialTool.GetManagerShapeOptions: TShapeOptions; @@ -2158,8 +2215,9 @@ function TVectorialTool.ToolCommand(ACommand: TToolCommand): boolean; Action.NotifyChange(toolDest, r); result := true; end; - tcForeAdjustToShape: if Assigned(FShape) then ShapeForeFill.FitGeometry(SuggestGradientBox); - tcBackAdjustToShape: if Assigned(FShape) then ShapeBackFill.FitGeometry(SuggestGradientBox); + tcForeAdjustToShape: if Assigned(FShape) then FShape.PenFill.FitGeometry(SuggestGradientBox); + tcBackAdjustToShape: if Assigned(FShape) then FShape.BackFill.FitGeometry(SuggestGradientBox); + tcOutlineAdjustToShape: if Assigned(FShape) then FShape.OutlineFill.FitGeometry(SuggestGradientBox); tcForeEditGradTexPoints: if Assigned(FShape) and not FQuickDefine then begin if FShape.Usermode = ForeGradTexMode then @@ -2172,6 +2230,12 @@ function TVectorialTool.ToolCommand(ACommand: TToolCommand): boolean; FShape.Usermode := vsuEdit else FShape.Usermode := BackGradTexMode; end; + tcOutlineEditGradTexPoints: if Assigned(FShape) and not FQuickDefine then + begin + if FShape.Usermode = OutlineGradTexMode then + FShape.Usermode := vsuEdit else + FShape.Usermode := OutlineGradTexMode; + end; tcFinish: begin toolDest := GetToolDrawingLayer; r := ValidateShape; @@ -2196,7 +2260,8 @@ function TVectorialTool.ToolProvideCommand(ACommand: TToolCommand): boolean; case ACommand of tcCopy,tcCut: Result:= not IsSelectingTool and not FQuickDefine and Assigned(FShape); tcFinish: result := not IsIdle; - tcForeAdjustToShape, tcBackAdjustToShape: result := not IsSelectingTool and Assigned(FShape) and not FQuickDefine; + tcForeAdjustToShape, tcBackAdjustToShape, tcOutlineAdjustToShape: + result := not IsSelectingTool and Assigned(FShape) and not FQuickDefine; tcForeEditGradTexPoints: result := not IsSelectingTool and Assigned(FShape) and not FQuickDefine and (vsuEditPenFill in FShape.Usermodes) and not (FShape.Usermode = vsuCreate); tcBackEditGradTexPoints: result := not IsSelectingTool and Assigned(FShape) and not FQuickDefine and diff --git a/lazpaint/uconfig.pas b/lazpaint/uconfig.pas index 2f5275f1..aa57d541 100644 --- a/lazpaint/uconfig.pas +++ b/lazpaint/uconfig.pas @@ -196,12 +196,16 @@ TLazPaintConfig = class //tools function DefaultToolForeColor: TBGRAPixel; function DefaultToolBackColor: TBGRAPixel; + function DefaultToolOutlineColor: TBGRAPixel; procedure SetDefaultToolForeColor(value: TBGRAPixel); procedure SetDefaultToolBackColor(value: TBGRAPixel); + procedure SetDefaultToolOutlineColor(value: TBGRAPixel); function DefaultToolForeGradient: string; function DefaultToolBackGradient: string; + function DefaultToolOutlineGradient: string; procedure SetDefaultToolForeGradient(value: string); procedure SetDefaultToolBackGradient(value: string); + procedure SetDefaultToolOutlineGradient(value: string); function DefaultToolPenWidth: single; procedure SetDefaultToolPenWidth(value: single); function DefaultToolEraserWidth: single; @@ -799,6 +803,11 @@ function TLazPaintConfig.DefaultToolBackColor: TBGRAPixel; result := StrToBGRA(iniOptions.ReadString('Tool','BackColor','0080FFC0')); end; +function TLazPaintConfig.DefaultToolOutlineColor: TBGRAPixel; +begin + result := StrToBGRA(iniOptions.ReadString('Tool','OutlineColor','FF0000C0')); +end; + procedure TLazPaintConfig.SetDefaultToolForeColor(value: TBGRAPixel); begin iniOptions.WriteString('Tool','ForeColor',BGRAToStr(value)); @@ -809,6 +818,11 @@ procedure TLazPaintConfig.SetDefaultToolBackColor(value: TBGRAPixel); iniOptions.WriteString('Tool','BackColor',BGRAToStr(value)); end; +procedure TLazPaintConfig.SetDefaultToolOutlineColor(value: TBGRAPixel); +begin + iniOptions.WriteString('Tool','OutlineColor',BGRAToStr(value)); +end; + function TLazPaintConfig.DefaultToolForeGradient: string; begin result := iniOptions.ReadString('Tool','ForeGradient',''); @@ -819,6 +833,11 @@ function TLazPaintConfig.DefaultToolBackGradient: string; result := iniOptions.ReadString('Tool','BackGradient',''); end; +function TLazPaintConfig.DefaultToolOutlineGradient: string; +begin + result := iniOptions.ReadString('Tool','OutlineGradient',''); +end; + procedure TLazPaintConfig.SetDefaultToolForeGradient(value: string); begin iniOptions.WriteString('Tool','ForeGradient',value); @@ -829,6 +848,11 @@ procedure TLazPaintConfig.SetDefaultToolBackGradient(value: string); iniOptions.WriteString('Tool','BackGradient',value); end; +procedure TLazPaintConfig.SetDefaultToolOutlineGradient(value: string); +begin + iniOptions.WriteString('Tool','OutlineGradient',value); +end; + function TLazPaintConfig.DefaultToolPenWidth: single; begin result := iniOptions.ReadFloat('Tool','PenWidth',5); diff --git a/lazpaintcontrols/lcvectororiginal.pas b/lazpaintcontrols/lcvectororiginal.pas index 617ff00b..92dbad8b 100644 --- a/lazpaintcontrols/lcvectororiginal.pas +++ b/lazpaintcontrols/lcvectororiginal.pas @@ -39,7 +39,7 @@ TVectorShapeDiff = class; TRenderBoundsOption = (rboAssumePenFill, rboAssumeBackFill); TRenderBoundsOptions = set of TRenderBoundsOption; - TVectorShapeField = (vsfPenFill, vsfPenWidth, vsfPenStyle, vsfJoinStyle, vsfBackFill, vsfOutlineFill); + TVectorShapeField = (vsfPenFill, vsfPenWidth, vsfPenStyle, vsfJoinStyle, vsfBackFill, vsfOutlineFill, vsfOutlineWidth); TVectorShapeFields = set of TVectorShapeField; TVectorShapeUsermode = (vsuEdit, vsuCreate, vsuEditPenFill, vsuEditBackFill, vsuEditOutlineFill, vsuCurveSetAuto, vsuCurveSetCurve, vsuCurveSetAngle, @@ -151,8 +151,6 @@ TVectorShape = class FBoundsBeforeUpdate: TRectF; FPenFill, FBackFill, FOutlineFill: TVectorialFill; FStoreTexturePointer: boolean; - FPenWidth: single; - FOutlineWidth: single; FStroker: TBGRAPenStroker; FUsermode: TVectorShapeUsermode; FContainer: TVectorOriginal; @@ -160,18 +158,19 @@ TVectorShape = class FDiffs: TVectorShapeDiffList; FFillChangeWithoutUpdate: boolean; FFillBeforeChangeBounds: TRectF; - function GetIsBack: boolean; - function GetIsFront: boolean; function GetIsUpdating: boolean; procedure SetContainer(AValue: TVectorOriginal); function GetFill(var AFillVariable: TVectorialFill): TVectorialFill; procedure SetFill(var AFillVariable: TVectorialFill; AValue: TVectorialFill; AUpdate: boolean); procedure SetId(AValue: integer); - procedure SetOutlineWidth(AValue: single); protected + FPenWidth: single; + FOutlineWidth: single; procedure BeginEditingUpdate; procedure EndEditingUpdate; procedure DoOnChange(ABoundsBefore: TRectF; ADiff: TVectorShapeDiff); virtual; + function GetIsBack: boolean; virtual; + function GetIsFront: boolean; virtual; function GetPenColor: TBGRAPixel; virtual; function GetPenWidth: single; virtual; function GetPenStyle: TBGRAPenStyle; virtual; @@ -179,13 +178,15 @@ TVectorShape = class function GetBackFill: TVectorialFill; virtual; function GetPenFill: TVectorialFill; virtual; function GetOutlineFill: TVectorialFill; virtual; + function GetOutlineWidth: single; virtual; procedure SetPenColor(AValue: TBGRAPixel); virtual; procedure SetPenWidth(AValue: single); virtual; procedure SetPenStyle({%H-}AValue: TBGRAPenStyle); virtual; - procedure SetJoinStyle(AValue: TPenJoinStyle); + procedure SetJoinStyle(AValue: TPenJoinStyle); virtual; procedure SetBackFill(AValue: TVectorialFill); virtual; procedure SetPenFill(AValue: TVectorialFill); virtual; procedure SetOutlineFill(AValue: TVectorialFill); virtual; + procedure SetOutlineWidth(AValue: single); virtual; procedure SetUsermode(AValue: TVectorShapeUsermode); virtual; function LoadTexture(AStorage: TBGRACustomOriginalStorage; AName: string): TBGRABitmap; procedure SaveTexture(AStorage: TBGRACustomOriginalStorage; AName: string; AValue: TBGRABitmap); @@ -194,7 +195,6 @@ TVectorShape = class function ComputeStroke(APoints: ArrayOfTPointF; AClosed: boolean; AStrokeMatrix: TAffineMatrix): ArrayOfTPointF; virtual; function ComputeStrokeEnvelope(APoints: ArrayOfTPointF; AClosed: boolean; AWidth: single): ArrayOfTPointF; virtual; function GetStroker: TBGRAPenStroker; - property Stroker: TBGRAPenStroker read GetStroker; procedure FillChange({%H-}ASender: TObject; var ADiff: TCustomVectorialFillDiff); virtual; procedure FillBeforeChange({%H-}ASender: TObject); virtual; procedure UpdateRenderStorage(ARenderBounds: TRect; AImage: TBGRACustomBitmap = nil); @@ -208,6 +208,8 @@ TVectorShape = class function GetPenVisible(AAssumePenFill: boolean = False): boolean; virtual; function GetPenVisibleNow: boolean; function GetBackVisible: boolean; virtual; + function GetOutlineVisible: boolean; virtual; + property Stroker: TBGRAPenStroker read GetStroker; public constructor Create(AContainer: TVectorOriginal); virtual; class function CreateFromStorage(AStorage: TBGRACustomOriginalStorage; AContainer: TVectorOriginal): TVectorShape; @@ -266,7 +268,7 @@ TVectorShape = class property OutlineFill: TVectorialFill read GetOutlineFill write SetOutlineFill; property PenWidth: single read GetPenWidth write SetPenWidth; property PenStyle: TBGRAPenStyle read GetPenStyle write SetPenStyle; - property OutlineWidth: single read FOutlineWidth write SetOutlineWidth; + property OutlineWidth: single read GetOutlineWidth write SetOutlineWidth; property JoinStyle: TPenJoinStyle read GetJoinStyle write SetJoinStyle; property Usermode: TVectorShapeUsermode read FUsermode write SetUsermode; property Container: TVectorOriginal read FContainer write SetContainer; @@ -278,6 +280,7 @@ TVectorShape = class property IsUpdating: boolean read GetIsUpdating; property BackVisible: boolean read GetBackVisible; property PenVisible: boolean read GetPenVisibleNow; + property OutlineVisible: boolean read GetOutlineVisible; end; TVectorShapes = specialize TFPGList; TVectorShapeAny = class of TVectorShape; @@ -1297,7 +1300,7 @@ procedure TVectorShape.Transform(const AMatrix: TAffineMatrix); TransformFill(AMatrix, False); zoom := (VectLen(AMatrix[1,1],AMatrix[2,1])+VectLen(AMatrix[1,2],AMatrix[2,2]))/2; if vsfPenWidth in Fields then PenWidth := zoom*PenWidth; - if vsfOutlineFill in Fields then OutlineWidth := zoom*OutlineWidth; + if vsfOutlineWidth in Fields then OutlineWidth := zoom*OutlineWidth; EndUpdate; end; @@ -1511,6 +1514,11 @@ function TVectorShape.GetIsUpdating: boolean; result := FUpdateCount > 0; end; +function TVectorShape.GetOutlineWidth: single; +begin + result := FOutlineWidth; +end; + function TVectorShape.GetFill(var AFillVariable: TVectorialFill): TVectorialFill; begin if AFillVariable = nil then @@ -1604,6 +1612,12 @@ function TVectorShape.GetBackVisible: boolean; result := (vsfBackFill in Fields) and not BackFill.IsFullyTransparent; end; +function TVectorShape.GetOutlineVisible: boolean; +begin + result := (vsfOutlineFill in Fields) and not OutlineFill.IsFullyTransparent and + (not (vsfOutlineWidth in Fields) or (OutlineWidth > 0)); +end; + procedure TVectorShape.TransformFill(const AMatrix: TAffineMatrix; ABackOnly: boolean); begin BeginUpdate; @@ -1950,7 +1964,7 @@ procedure TVectorShape.SetPenWidth(AValue: single); procedure TVectorShape.SetPenStyle(AValue: TBGRAPenStyle); begin - if PenStyleEqual(AValue, Stroker.CustomPenStyle) then exit; + if PenStyleEqual(AValue, PenStyle) then exit; BeginUpdate(TVectorShapeCommonDiff); Stroker.CustomPenStyle := AValue; EndUpdate; @@ -2077,11 +2091,8 @@ procedure TVectorShape.LoadFromStorage(AStorage: TBGRACustomOriginalStorage); else JoinStyle := pjsMiter; end; if vsfBackFill in f then LoadFill(AStorage, 'back', FBackFill); - if vsfOutlineFill in f then - begin - LoadFill(AStorage, 'outline', FOutlineFill); - OutlineWidth := AStorage.FloatDef['outline-width', DefaultShapeOutlineWidth]; - end; + if vsfOutlineFill in f then LoadFill(AStorage, 'outline', FOutlineFill); + if vsfOutlineWidth in f then OutlineWidth := AStorage.FloatDef['outline-width', DefaultShapeOutlineWidth]; EndUpdate; end; end; @@ -2103,13 +2114,16 @@ procedure TVectorShape.SaveToStorage(AStorage: TBGRACustomOriginalStorage); else AStorage.RawString['join-style'] := 'miter'; end; if vsfBackFill in f then SaveFill(AStorage, 'back', FBackFill); - if vsfOutlineFill in f then + if OutlineVisible then begin - SaveFill(AStorage, 'outline', FOutlineFill); - if OutlineFill.FillType <> vftNone then - AStorage.Float['outline-width'] := FOutlineWidth - else - AStorage.RemoveAttribute('outline-width'); + if vsfOutlineFill in f then SaveFill(AStorage, 'outline', FOutlineFill); + if vsfOutlineWidth in f then AStorage.Float['outline-width'] := FOutlineWidth + else AStorage.RemoveAttribute('outline-width'); + end else + begin + AStorage.RemoveObject('outline-fill'); + AStorage.RemoveAttribute('outline-color'); + AStorage.RemoveAttribute('outline-width'); end; end; diff --git a/lazpaintcontrols/lcvectortextshapes.pas b/lazpaintcontrols/lcvectortextshapes.pas index bcbb2066..aa62cdc7 100644 --- a/lazpaintcontrols/lcvectortextshapes.pas +++ b/lazpaintcontrols/lcvectortextshapes.pas @@ -1117,7 +1117,7 @@ destructor TTextShape.Destroy; class function TTextShape.Fields: TVectorShapeFields; begin - Result:= [vsfPenFill,vsfOutlineFill]; + Result:= [vsfPenFill,vsfOutlineFill,vsfOutlineWidth]; end; class function TTextShape.PreferPixelCentered: boolean; @@ -1327,7 +1327,7 @@ procedure TTextShape.Render(ADest: TBGRABitmap; ARenderOffset: TPoint; AMatrix: if HasOutline then begin ctx := tmpTransf.Canvas2D; - ctx.lineWidth := OutlineWidth; + ctx.lineWidth := zoom*OutlineWidth; ctx.lineJoinLCL:= pjsRound; ctx.lineStyle(psSolid); if OutlineFill.FillType = vftSolid then diff --git a/scripts/lazpaint/tools.py b/scripts/lazpaint/tools.py index 55f88d8c..6ff47f18 100644 --- a/scripts/lazpaint/tools.py +++ b/scripts/lazpaint/tools.py @@ -240,12 +240,18 @@ def set_fore_color(color): def set_back_color(color): command.send("ToolSetBackColor", Color=color) +def set_outline_color(color): + command.send("ToolSetOutlineColor", Color=color) + def get_fore_color(): return colors.str_to_RGBA(command.send("ToolGetForeColor?")) def get_back_color(): return colors.str_to_RGBA(command.send("ToolGetBackColor?")) +def get_outline_color(): + return colors.str_to_RGBA(command.send("ToolGetOutlineColor?")) + def set_eraser_mode(mode): command.send('ToolSetEraserMode', Mode=mode) @@ -429,6 +435,30 @@ def set_back_gradient_repetition(repetition): def get_back_gradient_repetition(): return command.send('ToolGetBackGradientRepetition?') +def set_outline_gradient_type(gradient_type): + command.send('ToolSetOutlineGradientType', GradientType=gradient_type) + +def get_outline_gradient_type(): + return command.send('ToolGetOutlineGradientType?') + +def set_outline_gradient_colors(colors: list): + command.send('ToolSetOutlineGradientColors', Colors=colors) + +def get_outline_gradient_colors() -> list: + return colors.str_to_RGBA(command.send('ToolGetOutlineGradientColors?')) + +def set_outline_gradient_interpolation(interpolation): + command.send('ToolSetOutlineGradientInterpolation', Interpolation=interpolation) + +def get_outline_gradient_interpolation(): + return command.send('ToolGetOutlineGradientInterpolation?') + +def set_outline_gradient_repetition(repetition): + command.send('ToolSetOutlineGradientRepetition', Repetition=repetition) + +def get_outline_gradient_repetition(): + return command.send('ToolGetOutlineGradientRepetition?') + def set_fore_texture(file_name): command.send('ToolSetForeTexture', FileName=file_name) @@ -459,6 +489,21 @@ def set_back_texture_opacity(opacity: int): def get_back_texture_opacity(): #-> int 0..255 return command.send('ToolGetBackTextureOpacity?') +def set_outline_texture(file_name): + command.send('ToolSetOutlineTexture', FileName=file_name) + +def set_outline_texture_repetition(repetition): + command.send('ToolSetOutlineTextureRepetition', Repetition=repetition) + +def get_outline_texture_repetition(): + return command.send('ToolGetOutlineTextureRepetition?') + +def set_outline_texture_opacity(opacity: int): + command.send('ToolSetOutlineTextureOpacity', Opacity=opacity) + +def get_outline_texture_opacity(): #-> int 0..255 + return command.send('ToolGetOutlineTextureOpacity?') + def set_phong_shape_kind(kind): command.send('ToolSetPhongShapeKind', Kind=kind) From bbd2010a21bf7061b099f3e8c154f11097f4c34d Mon Sep 17 00:00:00 2001 From: johann Date: Thu, 26 Mar 2020 13:03:50 +0100 Subject: [PATCH 39/53] multiselection, optimize size of frozen shape flattened image --- lazpaint/tools/utoolfloodfill.pas | 4 +- lazpaint/tools/utoolselect.pas | 2 +- lazpaint/tools/utoolvectorial.pas | 14 +- lazpaintcontrols/lcvectorclipboard.pas | 31 +- lazpaintcontrols/lcvectormultishape.pas | 779 +++++++++++++++++++++++- lazpaintcontrols/lcvectororiginal.pas | 542 ++++++++++++++--- 6 files changed, 1227 insertions(+), 145 deletions(-) diff --git a/lazpaint/tools/utoolfloodfill.pas b/lazpaint/tools/utoolfloodfill.pas index 56b9b108..8018688e 100644 --- a/lazpaint/tools/utoolfloodfill.pas +++ b/lazpaint/tools/utoolfloodfill.pas @@ -172,7 +172,7 @@ function TToolFloodFill.DoToolDown(toolDest: TBGRABitmap; pt: TPoint; ptOrig := AffineMatrixInverse(Manager.Image.LayerOriginalMatrix[Manager.Image.CurrentLayerIndex]) * ptF; for i := vectOrig.ShapeCount-1 downto 0 do begin - if (vsfPenFill in vectOrig.Shape[i].Fields) and + if (vsfPenFill in vectOrig.Shape[i].MultiFields) and vectOrig.Shape[i].PointInPen(ptOrig) then begin if not (vectOrig.Shape[i].PenFill.FillType = vftSolid) then break; @@ -187,7 +187,7 @@ function TToolFloodFill.DoToolDown(toolDest: TBGRABitmap; pt: TPoint; end; exit; end; - if (vsfBackFill in vectOrig.Shape[i].Fields) and + if (vsfBackFill in vectOrig.Shape[i].MultiFields) and vectOrig.Shape[i].PointInBack(ptOrig) then begin if not (vectOrig.Shape[i].BackFill.FillType = vftSolid) then break; diff --git a/lazpaint/tools/utoolselect.pas b/lazpaint/tools/utoolselect.pas index 22d6bd87..2828d566 100644 --- a/lazpaint/tools/utoolselect.pas +++ b/lazpaint/tools/utoolselect.pas @@ -149,7 +149,7 @@ procedure AssignSelectShapeStyle(AShape: TVectorShape; ASwapColor: boolean); var f: TVectorShapeFields; begin - f:= AShape.Fields; + f:= AShape.MultiFields; if vsfPenFill in f then AShape.PenFill.Clear; if vsfPenStyle in f Then AShape.PenStyle := ClearPenStyle; if vsfBackFill in f then diff --git a/lazpaint/tools/utoolvectorial.pas b/lazpaint/tools/utoolvectorial.pas index 5cdbac72..7ae4c33a 100644 --- a/lazpaint/tools/utoolvectorial.pas +++ b/lazpaint/tools/utoolvectorial.pas @@ -7,7 +7,7 @@ interface uses Classes, SysUtils, LCLType, BGRABitmap, BGRABitmapTypes, BGRALayerOriginal, BGRAGraphics, LCVectorOriginal, LCVectorialFill, - UTool, UImageType, ULayerAction, LCVectorRectShapes, + UTool, UImageType, ULayerAction, LCVectorRectShapes, LCVectorMultishape, BGRAGradientOriginal, UStateType; type @@ -388,7 +388,7 @@ procedure TEditShapeTool.UpdateToolManagerFromShape(AShape: TVectorShape); if AShape.Usermode in [vsuEditBackFill, vsuEditPenFill] then AShape.Usermode := vsuEdit; opt := Manager.ShapeOptions; - f := AShape.Fields; + f := AShape.MultiFields; doDraw := vsfPenFill in f; doFill := vsfBackFill in f; if vsfPenStyle in f then @@ -614,7 +614,7 @@ function TEditShapeTool.DoToolUpdate(toolDest: TBGRABitmap): TRect; gradBox := shape.SuggestGradientBox(AffineMatrixIdentity); m := AffineMatrixInverse(Manager.Image.LayerOriginalMatrix[Manager.Image.CurrentLayerIndex]); zoom := (VectLen(m[1,1],m[2,1])+VectLen(m[1,2],m[2,2]))/2; - f := shape.Fields; + f := shape.MultiFields; if f*[vsfPenFill,vsfBackFill,vsfPenStyle] = [vsfPenFill,vsfBackFill,vsfPenStyle] then begin doDraw := toDrawShape in Manager.ShapeOptions; @@ -886,7 +886,7 @@ function TEditShapeTool.GetContextualToolbars: TContextualToolbars; begin shape := GetVectorOriginal.SelectedShape; - f := shape.Fields; + f := shape.MultiFields; if vsfPenWidth in f then result += [ctPenWidth]; if vsfPenStyle in f then result += [ctPenStyle]; if vsfJoinStyle in f then result += [ctJoinStyle]; @@ -1763,7 +1763,7 @@ function TVectorialTool.GetGridMatrix: TAffineMatrix; else begin if Assigned(FShape) and - (not (vsfPenFill in FShape.Fields) or + (not (vsfPenFill in FShape.MultiFields) or (FShape.PenFill.IsFullyTransparent)) then result := AffineMatrixTranslation(0.5, 0.5) else @@ -1877,7 +1877,7 @@ procedure TVectorialTool.AssignShapeStyle(AMatrix: TAffineMatrix; AAlwaysFit: bo fitMode: TFitMode; begin zoom := (VectLen(AMatrix[1,1],AMatrix[2,1])+VectLen(AMatrix[1,2],AMatrix[2,2]))/2; - f := FShape.Fields; + f := FShape.MultiFields; gradBox := FShape.SuggestGradientBox(AffineMatrixIdentity); if vsfPenFill in f then begin @@ -1926,7 +1926,7 @@ procedure TVectorialTool.QuickDefineShape(AStart, AEnd: TPointF); function TVectorialTool.RoundCoordinate(constref ptF: TPointF): TPointF; begin if not (toDrawShape in GetManagerShapeOptions) or - (Assigned(FShape) and not (vsfPenFill in FShape.Fields)) then + (Assigned(FShape) and not (vsfPenFill in FShape.MultiFields)) then result := PointF(floor(ptF.x)+0.5,floor(ptF.y)+0.5) else result := PointF(round(ptF.x),round(ptF.y)); diff --git a/lazpaintcontrols/lcvectorclipboard.pas b/lazpaintcontrols/lcvectorclipboard.pas index e575d573..55e097fc 100644 --- a/lazpaintcontrols/lcvectorclipboard.pas +++ b/lazpaintcontrols/lcvectorclipboard.pas @@ -22,8 +22,9 @@ function CopyShapesToClipboard(AShapes: array of TVectorShape; const AMatrix: TA var tempContainer: TVectorOriginal; mem: TMemoryStream; - i: Integer; + i, j: Integer; s: TVectorShape; + multiSel: IVectorMultishape; begin result:= false; if length(AShapes)=0 then exit; @@ -32,9 +33,21 @@ function CopyShapesToClipboard(AShapes: array of TVectorShape; const AMatrix: TA try for i := 0 to high(AShapes) do begin - s := AShapes[i].Duplicate; - s.Transform(AMatrix); - tempContainer.AddShape(s); + if AShapes[i] is VectorMultiselectionFactory then + begin + multiSel := AShapes[i].GetAsMultishape; + for j := 0 to multiSel.ShapeCount-1 do + begin + s := multiSel.GetShape(j).Duplicate; + s.Transform(AMatrix); + tempContainer.AddShape(s); + end; + end else + begin + s := AShapes[i].Duplicate; + s.Transform(AMatrix); + tempContainer.AddShape(s); + end; end; tempContainer.SaveToStream(mem); Clipboard.Clear; @@ -52,6 +65,7 @@ procedure PasteShapesFromClipboard(ATargetContainer: TVectorOriginal; const ATar mem: TMemoryStream; i: Integer; pastedShape: TVectorShape; + pastedShapes: TVectorShapes; invMatrix, m: TAffineMatrix; pastedBounds: TRectF; ofs: TPointF; @@ -84,14 +98,17 @@ procedure PasteShapesFromClipboard(ATargetContainer: TVectorOriginal; const ATar ofs.y := floor(ABounds.Bottom - pastedBounds.Bottom); end; m := invMatrix*AffineMatrixTranslation(ofs.x,ofs.y); + ATargetContainer.DeselectShapes; + pastedShapes := TVectorShapes.Create; for i := 0 to tempContainer.ShapeCount-1 do begin pastedShape := tempContainer.Shape[i].Duplicate; pastedShape.Transform(m); - ATargetContainer.AddShape(pastedShape); - if i = tempContainer.ShapeCount-1 then - ATargetContainer.SelectShape(pastedShape); + pastedShapes.Add(pastedShape); end; + ATargetContainer.AddShapes(pastedShapes); + ATargetContainer.SelectShapes(pastedShapes); + pastedShapes.Free; end; finally tempContainer.Free; diff --git a/lazpaintcontrols/lcvectormultishape.pas b/lazpaintcontrols/lcvectormultishape.pas index a3b44bf8..71190d63 100644 --- a/lazpaintcontrols/lcvectormultishape.pas +++ b/lazpaintcontrols/lcvectormultishape.pas @@ -6,22 +6,83 @@ interface uses Classes, SysUtils, LCVectorRectShapes, LCVectorOriginal, BGRALayerOriginal, - BGRATransform, BGRABitmap, BGRABitmapTypes; + BGRATransform, BGRABitmap, BGRABitmapTypes, BGRAPen, fgl, LCVectorialFill; type + TShapeChangeHandlerMap = specialize TFPGMap; + TShapeDiffMap = specialize TFPGMap; + TIntegerList = specialize TFPGList; - { TVectorMultishape } + { TMultiSelectionShapesDiff } - TVectorMultishape = class(TCustomRectShape) + TMultiSelectionShapesDiff = class(TCustomMultiSelectionDiff) + protected + FDiffs: TShapeDiffMap; + FSelectedIds: TIntegerList; + function GetShapeById(AContainer: TVectorShape; AId: integer): TVectorShape; + function GetShapeCount: integer; override; + function GetShapeId(AIndex: integer): integer; override; + public + constructor Create(AStartShape: TVectorShape); override; + procedure ComputeDiff(AEndShape: TVectorShape); override; + procedure Apply(AStartShape: TVectorShape); override; + procedure Unapply(AEndShape: TVectorShape); override; + function CanAppend(ADiff: TVectorShapeDiff): boolean; override; + procedure Append(ADiff: TVectorShapeDiff); override; //does not preserve ADiff + procedure AppendForShape(AShape: TVectorShape; var ADiff: TVectorShapeDiff); //does not preserve ADiff + function IsIdentity: boolean; override; + destructor Destroy; override; + property ShapeCount: integer read GetShapeCount; + property ShapeId[AIndex: integer]: integer read GetShapeId; + end; + + { TVectorMultiselection } + + TVectorMultiselection = class(TCustomRectShape, IVectorMultishape) + protected + function QueryInterface({$IFDEF FPC_HAS_CONSTREF}constref{$ELSE}const{$ENDIF} IID: TGUID; out Obj): HResult; {$IF (not defined(WINDOWS)) AND (FPC_FULLVERSION>=20501)}cdecl{$ELSE}stdcall{$IFEND}; + function _AddRef: Integer; {$IF (not defined(WINDOWS)) AND (FPC_FULLVERSION>=20501)}cdecl{$ELSE}stdcall{$IFEND}; + function _Release: Integer; {$IF (not defined(WINDOWS)) AND (FPC_FULLVERSION>=20501)}cdecl{$ELSE}stdcall{$IFEND}; protected FShapes: TVectorShapes; + FOldChangeHandler: TShapeChangeHandlerMap; + FOnSelectionChange: TNotifyEvent; + FUpdatingFromShape, FInMultiTranformFill: Boolean; function GetCornerPositition: single; override; + procedure RestoreChangeHandler(AShape: TVectorShape); + procedure AttachChangeHandler(AShape: TVectorShape); + procedure ContainedShape_Change(ASender: TObject; ABounds: TRectF; ADiff: TVectorShapeDiff); + procedure UpdateFromShapes; + procedure UpdateFrameFromShapes; + procedure FillChange({%H-}ASender: TObject; var ADiff: TCustomVectorialFillDiff); override; + procedure FillBeforeChange({%H-}ASender: TObject); override; + procedure SetPenStyle(AValue: TBGRAPenStyle); override; + procedure SetPenWidth(AValue: single); override; + procedure SetJoinStyle(AValue: TPenJoinStyle); override; + procedure SetOutlineWidth(AValue: single); override; + function GetIsFront: boolean; override; + function GetIsBack: boolean; override; + function GetPenVisible(AAssumePenFill: boolean = False): boolean; override; + function GetBackVisible: boolean; override; + function GetOutlineVisible: boolean; override; + procedure NotifySelectionChanged; public constructor Create(AContainer: TVectorOriginal); override; - procedure Clear; + class function StorageClassName: RawByteString; override; + destructor Destroy; override; + procedure BeginUpdate(ADiffHandler: TVectorShapeDiffAny=nil); override; + procedure EndUpdate; override; + procedure ClearShapes; procedure AddShape(AShape: TVectorShape); procedure RemoveShape(AShape: TVectorShape); - function MultiFields: TVectorShapeFields; + function ContainsShape(AShape: TVectorShape): boolean; + function ShapeCount: integer; + function GetShape(AIndex: integer): TVectorShape; + function SetShapes(AShapes: TVectorShapes): boolean; + function FrontShape: TVectorShape; + function BackShape: TVectorShape; + function GetShapeById(AId: integer): TVectorShape; + function MultiFields: TVectorShapeFields; override; procedure TransformFrame(const AMatrix: TAffineMatrix); override; procedure TransformFill(const AMatrix: TAffineMatrix; ABackOnly: boolean); override; function AllowShearTransform: boolean; override; @@ -30,37 +91,533 @@ TVectorMultishape = class(TCustomRectShape) procedure Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; ADraft: boolean); overload; override; procedure Render(ADest: TBGRABitmap; ARenderOffset: TPoint; AMatrix: TAffineMatrix; ADraft: boolean); overload; override; function GetRenderBounds({%H-}ADestRect: TRect; AMatrix: TAffineMatrix; {%H-}AOptions: TRenderBoundsOptions = []): TRectF; override; + function GetAlignBounds(const ALayoutRect: TRect; const AMatrix: TAffineMatrix): TRectF; override; + function SuggestGradientBox(AMatrix: TAffineMatrix): TAffineBox; override; procedure ConfigureCustomEditor(AEditor: TBGRAOriginalEditor); override; function PointInShape(APoint: TPointF): boolean; overload; override; function PointInShape(APoint: TPointF; ARadius: single): boolean; overload; override; function PointInBack(APoint: TPointF): boolean; overload; override; function PointInPen(APoint: TPointF): boolean; overload; override; function GetIsSlow(const AMatrix: TAffineMatrix): boolean; override; - class function StorageClassName: RawByteString; override; - destructor Destroy; override; + function GetAsMultishape: IVectorMultishape; override; + procedure SetOnSelectionChange(AHandler: TNotifyEvent); + function GetOnSelectionChange: TNotifyEvent; + property OnSelectionChange: TNotifyEvent read GetOnSelectionChange write SetOnSelectionChange; end; implementation -{ TVectorMultishape } +function Shapes_CompareDepth(const Item1, Item2: TVectorShape): Integer; +var + idx1, idx2: Integer; +begin + if Assigned(Item1.Container) and Assigned(Item2.Container) then + begin + idx1 := Item1.Container.IndexOfShape(Item1); + idx2 := Item2.Container.IndexOfShape(Item2); + result := idx1 - idx2; + end; +end; + +{ TMultiSelectionShapesDiff } + +function TMultiSelectionShapesDiff.GetShapeCount: integer; +begin + result := FSelectedIds.Count; +end; + +function TMultiSelectionShapesDiff.GetShapeId(AIndex: integer): integer; +begin + result := FSelectedIds.Items[AIndex]; +end; + +function TMultiSelectionShapesDiff.GetShapeById(AContainer: TVectorShape; AId: integer): TVectorShape; +begin + result := AContainer.Container.FindShapeById(AId); +end; + +constructor TMultiSelectionShapesDiff.Create(AStartShape: TVectorShape); +var + i: Integer; +begin + if not (AStartShape is TVectorMultiselection) then + raise exception.Create('Expecting TVectorMultishape'); + FDiffs := TShapeDiffMap.Create; + FSelectedIds := TIntegerList.Create; + with AStartShape.GetAsMultishape do + begin + for i := 0 to ShapeCount-1 do + FSelectedIds.Add(GetShape(i).Id); + end; +end; + +procedure TMultiSelectionShapesDiff.ComputeDiff(AEndShape: TVectorShape); +begin + //nothing +end; + +procedure TMultiSelectionShapesDiff.Apply(AStartShape: TVectorShape); +var + s: TVectorShape; + i: Integer; +begin + for i := 0 to FDiffs.Count-1 do + begin + s := GetShapeById(AStartShape, FDiffs.Keys[i]); + if Assigned(s) then + FDiffs.Data[i].Apply(s); + end; +end; + +procedure TMultiSelectionShapesDiff.Unapply(AEndShape: TVectorShape); +var + s: TVectorShape; + i: Integer; +begin + for i := FDiffs.Count-1 downto 0 do + begin + s := GetShapeById(AEndShape, FDiffs.Keys[i]); + if Assigned(s) then + FDiffs.Data[i].Unapply(s); + end; +end; + +function TMultiSelectionShapesDiff.CanAppend(ADiff: TVectorShapeDiff): boolean; +var + other: TMultiSelectionShapesDiff; + i, j: Integer; +begin + if not (ADiff is TMultiSelectionShapesDiff) then exit(false); + other := TMultiSelectionShapesDiff(ADiff); + for i := 0 to other.FDiffs.Count-1 do + for j := 0 to FDiffs.Count-1 do + if FDiffs.Keys[j] = other.FDiffs.Keys[i] then + begin + if not FDiffs.Data[j].CanAppend(other.FDiffs.Data[i]) then + exit(false); + end; + result := true; +end; + +procedure TMultiSelectionShapesDiff.Append(ADiff: TVectorShapeDiff); +var found: boolean; + other: TMultiSelectionShapesDiff; + otherKey, i, j: integer; + otherData: TVectorShapeDiff; + toCopy: TShapeDiffMap; +begin + if not (ADiff is TMultiSelectionShapesDiff) then raise exception.Create('Unexpected diff type'); + other := TMultiSelectionShapesDiff(ADiff); + toCopy := TShapeDiffMap.Create; + for i := 0 to other.FDiffs.Count-1 do + begin + found := false; + otherKey := other.FDiffs.Keys[i]; + otherData := other.FDiffs.Data[i]; + for j := 0 to FDiffs.Count-1 do + if FDiffs.Keys[j] = otherKey then + begin + FDiffs.Data[j].Append(otherData); + found := true; + break; + end; + if not found then toCopy.Add(otherKey, otherData); + end; + for i := 0 to toCopy.Count-1 do + begin + FDiffs.Add(toCopy.Keys[i], toCopy.Data[i]); + other.FDiffs.Remove(toCopy.Keys[i]); + end; + toCopy.Free; +end; + +procedure TMultiSelectionShapesDiff.AppendForShape(AShape: TVectorShape; + var ADiff: TVectorShapeDiff); +var + idx: Integer; +begin + idx := FDiffs.IndexOf(AShape.Id); + if idx <> -1 then + FDiffs.Data[idx].Append(ADiff) + else + begin + FDiffs.Add(AShape.Id, ADiff); + ADiff := nil; + end; +end; + +function TMultiSelectionShapesDiff.IsIdentity: boolean; +var + i: Integer; +begin + for i := 0 to FDiffs.Count-1 do + if not FDiffs.Data[i].IsIdentity then exit(false); + result := true; +end; + +destructor TMultiSelectionShapesDiff.Destroy; +var + i: Integer; +begin + for i := 0 to FDiffs.Count-1 do + FDiffs.Data[i].Free; + FDiffs.Free; + FSelectedIds.Free; + inherited Destroy; +end; + +{ TVectorMultiselection } + +function TVectorMultiselection.QueryInterface({$IFDEF FPC_HAS_CONSTREF}constref{$ELSE}const{$ENDIF} IID: TGUID; out Obj): HResult; {$IF (not defined(WINDOWS)) AND (FPC_FULLVERSION>=20501)}cdecl{$ELSE}stdcall{$IFEND}; +begin + if GetInterface(iid, obj) then + Result := S_OK + else + Result := longint(E_NOINTERFACE); +end; + +function TVectorMultiselection._AddRef: Integer; {$IF (not defined(WINDOWS)) AND (FPC_FULLVERSION>=20501)}cdecl{$ELSE}stdcall{$IFEND}; +begin + result := 0; +end; -procedure TVectorMultishape.TransformFill(const AMatrix: TAffineMatrix; +function TVectorMultiselection._Release: Integer; {$IF (not defined(WINDOWS)) AND (FPC_FULLVERSION>=20501)}cdecl{$ELSE}stdcall{$IFEND}; +begin + result := 0; +end; + +procedure TVectorMultiselection.TransformFill(const AMatrix: TAffineMatrix; ABackOnly: boolean); var i: Integer; begin - BeginUpdate; + FInMultiTranformFill := true; + BeginUpdate(TMultiSelectionShapesDiff); for i := 0 to FShapes.Count-1 do + begin + FShapes[i].BeginUpdate; + FShapes[i].TransformFrame(AMatrix); FShapes[i].TransformFill(AMatrix, ABackOnly); + FShapes[i].EndUpdate; + end; + inherited TransformFill(AMatrix, ABackOnly); + EndUpdate; + FInMultiTranformFill := false; +end; + +procedure TVectorMultiselection.ContainedShape_Change(ASender: TObject; + ABounds: TRectF; ADiff: TVectorShapeDiff); +var + contained: TMultiSelectionShapesDiff; +begin + if Assigned(ADiff) then + begin + contained := TMultiSelectionShapesDiff(AddDiffHandler(TMultiSelectionShapesDiff)); + contained.AppendForShape(ASender as TVectorShape, ADiff); + ADiff.Free; + end else + if Assigned(OnChange) then + OnChange(self, ABounds, nil); +end; + +procedure TVectorMultiselection.UpdateFromShapes; +var + i: Integer; + found: boolean; +begin + if FShapes.Count > 0 then + begin + FUpdatingFromShape := true; + BeginEditingUpdate; + UpdateFrameFromShapes; + + found := false; + for i := 0 to FShapes.Count-1 do + if (vsfPenFill in FShapes[i].Fields) and + FShapes[i].PenVisible then + begin + PenFill.Assign(FShapes[i].PenFill); + found := true; + break; + end; + if not found then PenFill.Clear; + + found := false; + for i := 0 to FShapes.Count-1 do + if (vsfPenStyle in FShapes[i].Fields) and + FShapes[i].PenVisible then + begin + Stroker.CustomPenStyle := FShapes[i].PenStyle; + found := true; + break; + end; + if not found then Stroker.CustomPenStyle := ClearPenStyle; + + for i := 0 to FShapes.Count-1 do + if (vsfPenWidth in FShapes[i].Fields) and + FShapes[i].PenVisible then + begin + FPenWidth := FShapes[i].PenWidth; + break; + end; + + for i := 0 to FShapes.Count-1 do + if vsfJoinStyle in FShapes[i].Fields then + begin + Stroker.JoinStyle := FShapes[i].JoinStyle; + break; + end; + + found := false; + for i := 0 to FShapes.Count-1 do + if (vsfBackFill in FShapes[i].Fields) and + FShapes[i].BackVisible then + begin + BackFill.Assign(FShapes[i].BackFill); + found := true; + break; + end; + if not found then BackFill.Clear; + + found := false; + for i := 0 to FShapes.Count-1 do + if (vsfOutlineFill in FShapes[i].Fields) and + FShapes[i].OutlineVisible then + begin + OutlineFill.Assign(FShapes[i].OutlineFill); + found := true; + break; + end; + if not found then OutlineFill.Clear; + + for i := 0 to FShapes.Count-1 do + if (vsfOutlineWidth in FShapes[i].Fields) and + FShapes[i].OutlineVisible then + begin + FOutlineWidth:= FShapes[i].OutlineWidth; + break; + end; + + EndEditingUpdate; + FUpdatingFromShape := false; + end; +end; + +procedure TVectorMultiselection.UpdateFrameFromShapes; +var + rF: TRectF; + i: Integer; +begin + BeginEditingUpdate; + rF := EmptyRectF; + for i := 0 to FShapes.Count-1 do + rF := rF.Union(FShapes[i].GetAlignBounds(InfiniteRect, AffineMatrixIdentity), true); + FOrigin := (rF.TopLeft + rf.BottomRight)*0.5; + FXAxis := FOrigin + PointF(rF.Width/2, 0); + FYAxis := FOrigin + PointF(0, rF.Height/2); + EndEditingUpdate; +end; + +procedure TVectorMultiselection.FillChange(ASender: TObject; + var ADiff: TCustomVectorialFillDiff); +var + i: Integer; +begin + if FUpdatingFromShape or FInMultiTranformFill then exit; + BeginUpdate; + AddFillDiffHandler(ASender as TVectorialFill, ADiff); + if ASender = PenFill then + begin + for i := 0 to FShapes.Count-1 do + if vsfPenFill in FShapes[i].Fields then + begin + if not PenFill.IsFullyTransparent or FShapes[i].BackVisible or FShapes[i].OutlineVisible then + FShapes[i].PenFill.Assign(PenFill); + end; + end else + if ASender = BackFill then + begin + for i := 0 to FShapes.Count-1 do + if vsfBackFill in FShapes[i].Fields then + begin + if not BackFill.IsFullyTransparent or FShapes[i].PenVisible or FShapes[i].OutlineVisible then + FShapes[i].BackFill.Assign(BackFill); + end; + end else + if ASender = OutlineFill then + begin + for i := 0 to FShapes.Count-1 do + if vsfOutlineFill in FShapes[i].Fields then + begin + if not OutlineFill.IsFullyTransparent or FShapes[i].PenVisible or FShapes[i].BackVisible then + FShapes[i].OutlineFill.Assign(OutlineFill); + end; + end; + EndUpdate; +end; + +procedure TVectorMultiselection.FillBeforeChange(ASender: TObject); +begin + //nothing +end; + +procedure TVectorMultiselection.SetPenStyle(AValue: TBGRAPenStyle); +var + i: Integer; +begin + if PenStyleEqual(AValue, PenStyle) then exit; + BeginUpdate; + inherited SetPenStyle(AValue); + for i := 0 to FShapes.Count-1 do + if vsfPenStyle in FShapes[i].Fields then + begin + if not IsClearPenStyle(AValue) or FShapes[i].BackVisible then + FShapes[i].PenStyle := AValue; + end; + EndUpdate; +end; + +procedure TVectorMultiselection.SetPenWidth(AValue: single); +var + i: Integer; +begin + if AValue < 0 then AValue := 0; + if AValue = PenWidth then exit; + BeginUpdate; + inherited SetPenWidth(AValue); + for i := 0 to FShapes.Count-1 do + if vsfPenWidth in FShapes[i].Fields then + begin + if (AValue > 0) or FShapes[i].BackVisible then + FShapes[i].PenWidth := AValue; + end; + EndUpdate; +end; + +procedure TVectorMultiselection.SetJoinStyle(AValue: TPenJoinStyle); +var + i: Integer; +begin + if AValue = JoinStyle then exit; + BeginUpdate; + inherited SetJoinStyle(AValue); + for i := 0 to FShapes.Count-1 do + if vsfJoinStyle in FShapes[i].Fields then + FShapes[i].JoinStyle := AValue; EndUpdate; end; -function TVectorMultishape.GetCornerPositition: single; +procedure TVectorMultiselection.SetOutlineWidth(AValue: single); +var + i: Integer; +begin + if AValue < 0 then AValue := 0; + if AValue = OutlineWidth then exit; + BeginUpdate; + inherited SetOutlineWidth(AValue); + for i := 0 to FShapes.Count-1 do + if vsfOutlineWidth in FShapes[i].Fields then + FShapes[i].OutlineWidth := AValue; + EndUpdate; +end; + +function TVectorMultiselection.GetIsFront: boolean; +var + i, containerIdx: Integer; + s: TVectorShape; +begin + s := FrontShape; + if not Assigned(s) or not s.IsFront then exit(false); + containerIdx := Container.IndexOfShape(s); + for i := FShapes.Count-2 downto 0 do + begin + dec(containerIdx); + if Container.IndexOfShape(FShapes[i]) <> containerIdx then + exit(false); + end; + result := true; +end; + +function TVectorMultiselection.GetIsBack: boolean; +var + i, containerIdx: Integer; + s: TVectorShape; +begin + s := BackShape; + if not Assigned(s) or not s.IsBack then exit(false); + containerIdx := Container.IndexOfShape(s); + for i := 1 to FShapes.Count-1 do + begin + inc(containerIdx); + if Container.IndexOfShape(FShapes[i]) <> containerIdx then + exit(false); + end; + result := true; +end; + +function TVectorMultiselection.GetPenVisible(AAssumePenFill: boolean): boolean; +var + i: Integer; +begin + for i := 0 to ShapeCount-1 do + if FShapes[i].PenVisible then exit(true); + result := false; +end; + +function TVectorMultiselection.GetBackVisible: boolean; +var + i: Integer; +begin + for i := 0 to ShapeCount-1 do + if FShapes[i].BackVisible then exit(true); + result := false; +end; + +function TVectorMultiselection.GetOutlineVisible: boolean; +var + i: Integer; +begin + for i := 0 to ShapeCount-1 do + if FShapes[i].OutlineVisible then exit(true); + Result:= false; +end; + +procedure TVectorMultiselection.NotifySelectionChanged; +begin + if OnSelectionChange <> nil then + OnSelectionChange(self); +end; + +function TVectorMultiselection.GetCornerPositition: single; begin result := 1; end; -function TVectorMultishape.AllowShearTransform: boolean; +procedure TVectorMultiselection.RestoreChangeHandler(AShape: TVectorShape); +var + handlerIndex: Integer; +begin + if AShape.OnChange <> @ContainedShape_Change then exit; + handlerIndex := FOldChangeHandler.IndexOf(AShape); + if handlerIndex <> -1 then + begin + AShape.OnChange:= FOldChangeHandler.Data[handlerIndex]; + FOldChangeHandler.Delete(handlerIndex); + end + else + AShape.OnChange:= nil; +end; + +procedure TVectorMultiselection.AttachChangeHandler(AShape: TVectorShape); +begin + if AShape.OnChange <> @ContainedShape_Change then + begin + FOldChangeHandler.Add(AShape, AShape.OnChange); + AShape.OnChange:= @ContainedShape_Change; + end; +end; + +function TVectorMultiselection.AllowShearTransform: boolean; var i: Integer; begin @@ -69,17 +626,17 @@ function TVectorMultishape.AllowShearTransform: boolean; result := true; end; -procedure TVectorMultishape.LoadFromStorage(AStorage: TBGRACustomOriginalStorage); +procedure TVectorMultiselection.LoadFromStorage(AStorage: TBGRACustomOriginalStorage); begin raise exception.Create('Cannot be deserialized'); end; -procedure TVectorMultishape.SaveToStorage(AStorage: TBGRACustomOriginalStorage); +procedure TVectorMultiselection.SaveToStorage(AStorage: TBGRACustomOriginalStorage); begin raise exception.Create('Cannot be serialized'); end; -procedure TVectorMultishape.Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; +procedure TVectorMultiselection.Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; ADraft: boolean); var i: Integer; @@ -88,7 +645,7 @@ procedure TVectorMultishape.Render(ADest: TBGRABitmap; AMatrix: TAffineMatrix; FShapes[i].Render(ADest, AMatrix, ADraft); end; -procedure TVectorMultishape.Render(ADest: TBGRABitmap; ARenderOffset: TPoint; +procedure TVectorMultiselection.Render(ADest: TBGRABitmap; ARenderOffset: TPoint; AMatrix: TAffineMatrix; ADraft: boolean); var i: Integer; @@ -97,7 +654,7 @@ procedure TVectorMultishape.Render(ADest: TBGRABitmap; ARenderOffset: TPoint; FShapes[i].Render(ADest, ARenderOffset, AMatrix, ADraft); end; -function TVectorMultishape.GetRenderBounds(ADestRect: TRect; +function TVectorMultiselection.GetRenderBounds(ADestRect: TRect; AMatrix: TAffineMatrix; AOptions: TRenderBoundsOptions): TRectF; var i: Integer; @@ -107,7 +664,33 @@ function TVectorMultishape.GetRenderBounds(ADestRect: TRect; result := result.Union(FShapes[i].GetRenderBounds(ADestRect, AMatrix, AOptions), true); end; -procedure TVectorMultishape.ConfigureCustomEditor(AEditor: TBGRAOriginalEditor); +function TVectorMultiselection.GetAlignBounds(const ALayoutRect: TRect; + const AMatrix: TAffineMatrix): TRectF; +var + i: Integer; +begin + result := EmptyRectF; + for i := 0 to FShapes.Count-1 do + result := result.Union(FShapes[i].GetAlignBounds(ALayoutRect, AMatrix), true); +end; + +function TVectorMultiselection.SuggestGradientBox(AMatrix: TAffineMatrix): TAffineBox; +var + i: Integer; + r: TRectF; +begin + if FShapes.Count = 1 then + result := FShapes[i].SuggestGradientBox(AMatrix) + else + begin + r := EmptyRectF; + for i := 0 to FShapes.Count-1 do + r := r.Union(FShapes[i].SuggestGradientBox(AMatrix).RectBoundsF, true); + result := TAffineBox.AffineBox(r); + end; +end; + +procedure TVectorMultiselection.ConfigureCustomEditor(AEditor: TBGRAOriginalEditor); var i: Integer; ab: TAffineBox; @@ -120,7 +703,7 @@ procedure TVectorMultishape.ConfigureCustomEditor(AEditor: TBGRAOriginalEditor); inherited ConfigureCustomEditor(AEditor); end; -function TVectorMultishape.PointInShape(APoint: TPointF): boolean; +function TVectorMultiselection.PointInShape(APoint: TPointF): boolean; var i: LongInt; begin @@ -129,7 +712,7 @@ function TVectorMultishape.PointInShape(APoint: TPointF): boolean; result := false; end; -function TVectorMultishape.PointInShape(APoint: TPointF; ARadius: single): boolean; +function TVectorMultiselection.PointInShape(APoint: TPointF; ARadius: single): boolean; var i: LongInt; begin @@ -138,7 +721,7 @@ function TVectorMultishape.PointInShape(APoint: TPointF; ARadius: single): boole result := false; end; -function TVectorMultishape.PointInBack(APoint: TPointF): boolean; +function TVectorMultiselection.PointInBack(APoint: TPointF): boolean; var i: LongInt; begin @@ -147,7 +730,7 @@ function TVectorMultishape.PointInBack(APoint: TPointF): boolean; result := false; end; -function TVectorMultishape.PointInPen(APoint: TPointF): boolean; +function TVectorMultiselection.PointInPen(APoint: TPointF): boolean; var i: LongInt; begin @@ -156,7 +739,7 @@ function TVectorMultishape.PointInPen(APoint: TPointF): boolean; result := false; end; -function TVectorMultishape.GetIsSlow(const AMatrix: TAffineMatrix): boolean; +function TVectorMultiselection.GetIsSlow(const AMatrix: TAffineMatrix): boolean; var i: LongInt; begin @@ -166,27 +749,132 @@ function TVectorMultishape.GetIsSlow(const AMatrix: TAffineMatrix): boolean; result := false; end; -class function TVectorMultishape.StorageClassName: RawByteString; +function TVectorMultiselection.GetAsMultishape: IVectorMultishape; +begin + Result:= self; +end; + +procedure TVectorMultiselection.SetOnSelectionChange(AHandler: TNotifyEvent); +begin + FOnSelectionChange := AHandler; +end; + +function TVectorMultiselection.GetOnSelectionChange: TNotifyEvent; +begin + result := FOnSelectionChange; +end; + +class function TVectorMultiselection.StorageClassName: RawByteString; begin result := 'multishape'; end; -procedure TVectorMultishape.Clear; +procedure TVectorMultiselection.ClearShapes; +var + i: Integer; begin + if FShapes.Count = 0 then exit; + for i := 0 to FShapes.Count-1 do + RestoreChangeHandler(FShapes[i]); FShapes.Clear; + UpdateFromShapes; + NotifySelectionChanged; end; -procedure TVectorMultishape.AddShape(AShape: TVectorShape); +procedure TVectorMultiselection.AddShape(AShape: TVectorShape); begin + if ContainsShape(AShape) then exit; FShapes.Add(AShape); + FShapes.Sort(@Shapes_CompareDepth); + AttachChangeHandler(AShape); + UpdateFromShapes; + NotifySelectionChanged; end; -procedure TVectorMultishape.RemoveShape(AShape: TVectorShape); +procedure TVectorMultiselection.RemoveShape(AShape: TVectorShape); begin + RestoreChangeHandler(AShape); FShapes.Remove(AShape); + UpdateFromShapes; + NotifySelectionChanged; +end; + +function TVectorMultiselection.ContainsShape(AShape: TVectorShape): boolean; +begin + result := FShapes.IndexOf(AShape) <> -1; +end; + +function TVectorMultiselection.ShapeCount: integer; +begin + result := FShapes.Count; end; -function TVectorMultishape.MultiFields: TVectorShapeFields; +function TVectorMultiselection.GetShape(AIndex: integer): TVectorShape; +begin + if (AIndex < 0) or (AIndex >= FShapes.Count) then + raise exception.Create('Index out of bounds'); + result := FShapes[AIndex]; +end; + +function TVectorMultiselection.SetShapes(AShapes: TVectorShapes): boolean; +var + i: Integer; + different: Boolean; +begin + different := false; + for i := 0 to FShapes.Count-1 do + if AShapes.IndexOf(FShapes[i]) = -1 then + begin + different := true; + break; + end; + for i := 0 to AShapes.Count-1 do + if FShapes.IndexOf(AShapes[i]) = -1 then + begin + different := true; + break; + end; + if not different then exit(false); + + for i := 0 to FShapes.Count-1 do + RestoreChangeHandler(FShapes[i]); + FShapes.Clear; + + for i := 0 to AShapes.Count-1 do + begin + FShapes.Add(AShapes[i]); + AttachChangeHandler(AShapes[i]); + end; + FShapes.Sort(@Shapes_CompareDepth); + UpdateFromShapes; + NotifySelectionChanged; + exit(true); +end; + +function TVectorMultiselection.FrontShape: TVectorShape; +begin + if FShapes.Count > 0 then + result := FShapes[FShapes.Count-1] + else result := nil; +end; + +function TVectorMultiselection.BackShape: TVectorShape; +begin + if FShapes.Count > 0 then + result := FShapes[0] + else result := nil; +end; + +function TVectorMultiselection.GetShapeById(AId: integer): TVectorShape; +var + i: Integer; +begin + for i := 0 to FShapes.Count-1 do + if FShapes[i].Id = AId then exit(FShapes[i]); + result := nil; +end; + +function TVectorMultiselection.MultiFields: TVectorShapeFields; var i: Integer; begin @@ -195,28 +883,53 @@ function TVectorMultishape.MultiFields: TVectorShapeFields; result += FShapes[i].Fields; end; -constructor TVectorMultishape.Create(AContainer: TVectorOriginal); +constructor TVectorMultiselection.Create(AContainer: TVectorOriginal); begin inherited Create(AContainer); FShapes := TVectorShapes.Create; + FOldChangeHandler := TShapeChangeHandlerMap.Create; end; -procedure TVectorMultishape.TransformFrame(const AMatrix: TAffineMatrix); +procedure TVectorMultiselection.TransformFrame(const AMatrix: TAffineMatrix); var i: Integer; begin - BeginUpdate; + BeginUpdate(TMultiSelectionShapesDiff); for i := 0 to FShapes.Count-1 do FShapes[i].TransformFrame(AMatrix); + inherited TransformFrame(AMatrix); EndUpdate; end; -destructor TVectorMultishape.Destroy; +destructor TVectorMultiselection.Destroy; begin - Clear; + ClearShapes; FShapes.Free; + FOldChangeHandler.Free; inherited Destroy; end; +procedure TVectorMultiselection.BeginUpdate(ADiffHandler: TVectorShapeDiffAny); +var + i: Integer; +begin + inherited BeginUpdate(ADiffHandler); + for i := 0 to FShapes.Count-1 do + FShapes[i].BeginUpdate; +end; + +procedure TVectorMultiselection.EndUpdate; +var + i: Integer; +begin + for i := 0 to FShapes.Count-1 do + FShapes[i].EndUpdate; + inherited EndUpdate; +end; + +initialization + + VectorMultiselectionFactory := TVectorMultiselection; + end. diff --git a/lazpaintcontrols/lcvectororiginal.pas b/lazpaintcontrols/lcvectororiginal.pas index 92dbad8b..d4271293 100644 --- a/lazpaintcontrols/lcvectororiginal.pas +++ b/lazpaintcontrols/lcvectororiginal.pas @@ -46,6 +46,7 @@ TVectorShapeDiff = class; vsuEditText); TVectorShapeUsermodes = set of TVectorShapeUsermode; TVectorShape = class; + TVectorShapes = specialize TFPGList; { TVectorShapeDiff } @@ -58,6 +59,16 @@ TVectorShapeDiff = class procedure Append(ADiff: TVectorShapeDiff); virtual; abstract; function IsIdentity: boolean; virtual; abstract; end; + + TCustomMultiSelectionDiff = class(TVectorShapeDiff) + protected + function GetShapeCount: integer; virtual; abstract; + function GetShapeId(AIndex: integer): integer; virtual; abstract; + public + property ShapeCount: integer read GetShapeCount; + property ShapeId[AIndex: integer]: integer read GetShapeId; + end; + TVectorShapeDiffList = specialize TFPGList; TVectorShapeDiffAny = class of TVectorShapeDiff; @@ -77,6 +88,7 @@ TVectorShapeComposedDiff = class(TVectorShapeDiff) function CanAppend(ADiff: TVectorShapeDiff): boolean; override; procedure Append(ADiff: TVectorShapeDiff); override; function IsIdentity: boolean; override; + function GetMultiselection: TCustomMultiSelectionDiff; end; { TVectorShapeEmbeddedFillDiff } @@ -138,6 +150,20 @@ TVectorShapeCommonFillDiff = class(TVectorShapeDiff) function IsIdentity: boolean; override; end; + IVectorMultishape = interface + procedure ClearShapes; + procedure AddShape(AShape: TVectorShape); + procedure RemoveShape(AShape: TVectorShape); + function ContainsShape(AShape: TVectorShape): boolean; + function ShapeCount: integer; + function GetShape(AIndex: integer): TVectorShape; + function SetShapes(AShapes: TVectorShapes): boolean; + function FrontShape: TVectorShape; + function BackShape: TVectorShape; + procedure SetOnSelectionChange(AHandler: TNotifyEvent); + function GetOnSelectionChange: TNotifyEvent; + end; + { TVectorShape } TVectorShape = class @@ -214,8 +240,8 @@ TVectorShape = class constructor Create(AContainer: TVectorOriginal); virtual; class function CreateFromStorage(AStorage: TBGRACustomOriginalStorage; AContainer: TVectorOriginal): TVectorShape; destructor Destroy; override; - procedure BeginUpdate(ADiffHandler: TVectorShapeDiffAny=nil); - procedure EndUpdate; + procedure BeginUpdate(ADiffHandler: TVectorShapeDiffAny=nil); virtual; + procedure EndUpdate; virtual; procedure FillFit; procedure QuickDefine(constref APoint1,APoint2: TPointF); virtual; abstract; //one of the two Render functions must be overriden @@ -251,10 +277,12 @@ TVectorShape = class function GetIsSlow(const {%H-}AMatrix: TAffineMatrix): boolean; virtual; function GetGenericCost: integer; virtual; function GetUsedTextures: ArrayOfBGRABitmap; virtual; + function GetAsMultishape: IVectorMultishape; virtual; procedure Transform(const AMatrix: TAffineMatrix); virtual; procedure TransformFrame(const AMatrix: TAffineMatrix); virtual; abstract; procedure TransformFill(const AMatrix: TAffineMatrix; ABackOnly: boolean); virtual; function AllowShearTransform: boolean; virtual; + function MultiFields: TVectorShapeFields; virtual; class function Fields: TVectorShapeFields; virtual; class function Usermodes: TVectorShapeUsermodes; virtual; class function PreferPixelCentered: boolean; virtual; @@ -282,7 +310,6 @@ TVectorShape = class property PenVisible: boolean read GetPenVisibleNow; property OutlineVisible: boolean read GetOutlineVisible; end; - TVectorShapes = specialize TFPGList; TVectorShapeAny = class of TVectorShape; TVectorOriginalSelectShapeEvent = procedure(ASender: TObject; AShape: TVectorShape; APreviousShape: TVectorShape) of object; @@ -293,6 +320,7 @@ TVectorOriginalShapeDiff = class(TBGRAOriginalDiff) protected FShapeIndex: integer; FShapeDiff: TVectorShapeDiff; + function GetShape(AOriginal: TBGRALayerCustomOriginal): TVectorShape; public constructor Create(AShapeIndex: integer; AShapeDiff: TVectorShapeDiff); destructor Destroy; override; @@ -341,15 +369,21 @@ TVectorOriginalEditor = class; { TVectorOriginal } TVectorOriginal = class(TBGRALayerCustomOriginal) + private + procedure MultiSelection_SelectionChange(Sender: TObject); protected FShapes: TVectorShapes; FDeletedShapes: TVectorShapes; FSelectedShape: TVectorShape; + FMultiselection: TVectorShape; FFrozenShapesUnderSelection, FFrozenShapesOverSelection: TBGRABitmap; + FFrozenShapesUnderBounds, + FFrozenShapesOverBounds: TRect; FFrozenShapesRenderOffset: TPoint; FFrozenShapesComputed: boolean; FFrozenShapeMatrix: TAffineMatrix; + FUnfrozenRangeStart, FUnfrozenRangeEnd: integer; FOnSelectShape: TVectorOriginalSelectShapeEvent; FTextures: array of record Bitmap: TBGRABitmap; @@ -369,11 +403,11 @@ TVectorOriginal = class(TBGRALayerCustomOriginal) procedure ClearTextures; function GetShapeCount: integer; function OpenShapeRenderStorage(AShapeIndex: integer; ACreate: boolean): TBGRACustomOriginalStorage; - function FindShapeById(AId: integer): TVectorShape; procedure DiscardUnusedRenderStorage; function InternalInsertShape(AShape: TVectorShape; AIndex: integer): TRectF; function InternalInsertShapeRange(AShapes: TVectorShapes; AIndex: integer): TRectF; function InternalDeleteShapeRange(AStartIndex,ACount: integer): TRectF; + function GetNewShapeId: integer; public constructor Create; override; destructor Destroy; override; @@ -383,19 +417,23 @@ TVectorOriginal = class(TBGRALayerCustomOriginal) procedure DiscardUnusedTextures; function AddShape(AShape: TVectorShape): integer; overload; function AddShape(AShape: TVectorShape; AUsermode: TVectorShapeUsermode): integer; overload; + function AddShapes(AShapes: TVectorShapes): integer; procedure InsertShape(AShape: TVectorShape; AIndex: integer); - procedure InsertShapeRange(AShapes: TVectorShapes; AIndex: integer); + procedure InsertShapes(AShapes: TVectorShapes; AIndex: integer); function RemoveShape(AShape: TVectorShape): boolean; procedure DeleteShape(AIndex: integer); procedure DeleteShapeRange(AStartIndex,ACount: integer); procedure ReplaceShape(AIndex: integer; ANewShape: TVectorShape); procedure ReplaceShapeRange(AStartIndex: integer; ACountBefore: integer; ANewShapes: TVectorShapes); - procedure SelectShape(AIndex: integer); overload; - procedure SelectShape(AShape: TVectorShape); overload; - procedure DeselectShape; + function SelectShapes(AShapes: TVectorShapes): boolean; + function SelectShape(AIndex: integer; AToggle: boolean = false): boolean; overload; + function SelectShape(AShape: TVectorShape; AToggle: boolean = false): boolean; overload; + function DeselectShapes: boolean; + procedure DeselectShape(AIndex: integer); overload; + procedure DeselectShape(AShape: TVectorShape); overload; function GetShapesCost: integer; function PreferDraftMode(AEditor: TBGRAOriginalEditor; const AMatrix: TAffineMatrix): boolean; - function MouseClick(APoint: TPointF; ARadius: single): boolean; + function MouseClick(APoint: TPointF; ARadius: single; AToggle: boolean): boolean; procedure Render(ADest: TBGRABitmap; ARenderOffset: TPoint; AMatrix: TAffineMatrix; ADraft: boolean); override; procedure ConfigureEditor(AEditor: TBGRAOriginalEditor); override; function CreateEditor: TBGRAOriginalEditor; override; @@ -405,6 +443,7 @@ TVectorOriginal = class(TBGRALayerCustomOriginal) procedure LoadFromStorage(AStorage: TBGRACustomOriginalStorage); override; procedure SaveToStorage(AStorage: TBGRACustomOriginalStorage); override; function IndexOfShape(AShape: TVectorShape): integer; + function FindShapeById(AId: integer): TVectorShape; procedure MoveShapeToIndex(AFromIndex: integer; AToIndex: integer); class function StorageClassName: RawByteString; override; property OnSelectShape: TVectorOriginalSelectShapeEvent read FOnSelectShape write FOnSelectShape; @@ -448,6 +487,9 @@ function MatrixForPixelCentered(const AMatrix: TAffineMatrix): TAffineMatrix; procedure RegisterVectorShape(AClass: TVectorShapeAny); function GetVectorShapeByStorageClassName(AName: string): TVectorShapeAny; +var + VectorMultiselectionFactory: TVectorShapeAny; + implementation uses math, BGRATransform, BGRAFillInfo, BGRAGraphics, BGRAPath, Types, @@ -731,6 +773,44 @@ function TVectorOriginalShapeRangeDiff.IsIdentity: boolean; { TVectorOriginalShapeDiff } +function TVectorOriginalShapeDiff.GetShape(AOriginal: TBGRALayerCustomOriginal): TVectorShape; + + procedure UpdateMultiSelection(AOriginal: TVectorOriginal; AMultiDiff: TCustomMultiSelectionDiff); + var + i: Integer; + containedShapes: TVectorShapes; + s, s2: TVectorShape; + begin + containedShapes := TVectorShapes.Create; + for i := 0 to AMultiDiff.ShapeCount-1 do + begin + s2 := AOriginal.FindShapeById(AMultiDiff.ShapeId[i]); + if Assigned(s2) then containedShapes.Add(s2); + end; + AOriginal.SelectShapes(containedShapes); + containedShapes.Free; + end; + +var + multiDiff: TCustomMultiSelectionDiff; + orig: TVectorOriginal; + +begin + orig := (AOriginal as TVectorOriginal); + if FShapeIndex = -2 then + begin + result := orig.FMultiselection; + if FShapeDiff is TCustomMultiSelectionDiff then + UpdateMultiSelection(orig, TCustomMultiSelectionDiff(FShapeDiff)) else + if FShapeDiff is TVectorShapeComposedDiff then + begin + multiDiff := TVectorShapeComposedDiff(FShapeDiff).GetMultiselection; + if Assigned(multiDiff) then UpdateMultiSelection(orig, multiDiff); + end; + end else + result := orig.Shape[FShapeIndex]; +end; + constructor TVectorOriginalShapeDiff.Create(AShapeIndex: integer; AShapeDiff: TVectorShapeDiff); begin @@ -746,12 +826,12 @@ destructor TVectorOriginalShapeDiff.Destroy; procedure TVectorOriginalShapeDiff.Apply(AOriginal: TBGRALayerCustomOriginal); begin - FShapeDiff.Apply((AOriginal as TVectorOriginal).Shape[FShapeIndex]); + FShapeDiff.Apply(GetShape(AOriginal)); end; procedure TVectorOriginalShapeDiff.Unapply(AOriginal: TBGRALayerCustomOriginal); begin - FShapeDiff.Unapply((AOriginal as TVectorOriginal).Shape[FShapeIndex]); + FShapeDiff.Unapply(GetShape(AOriginal)); end; function TVectorOriginalShapeDiff.CanAppend(ADiff: TBGRAOriginalDiff): boolean; @@ -980,7 +1060,7 @@ function TVectorShapeComposedDiff.CanAppend(ADiff: TVectorShapeDiff): boolean; result := true; end else begin - for i := 0 to high(FDiffs) do + for i := high(FDiffs) downto 0 do if FDiffs[i].CanAppend(ADiff) then exit(true); exit(false); end; @@ -998,9 +1078,12 @@ procedure TVectorShapeComposedDiff.Append(ADiff: TVectorShapeDiff); Append(next.FDiffs[i]); end else begin - for i := 0 to high(FDiffs) do + for i := high(FDiffs) downto 0 do if FDiffs[i].CanAppend(ADiff) then + begin FDiffs[i].Append(ADiff); + exit; + end; end; end; @@ -1013,6 +1096,16 @@ function TVectorShapeComposedDiff.IsIdentity: boolean; result := true; end; +function TVectorShapeComposedDiff.GetMultiselection: TCustomMultiSelectionDiff; +var + i: Integer; +begin + for i := 0 to high(FDiffs) do + if FDiffs[i] is TCustomMultiSelectionDiff then + exit(TCustomMultiSelectionDiff(FDiffs[i])); + result := nil; +end; + { TVectorOriginalEditor } constructor TVectorOriginalEditor.Create(AOriginal: TVectorOriginal); @@ -1195,7 +1288,7 @@ procedure TVectorOriginalEditor.KeyDown(Shift: TShiftState; Key: TSpecialKey; ou if (Key = skReturn) and ([ssShift,ssCtrl,ssAlt]*Shift = []) then begin - FOriginal.DeselectShape; + FOriginal.DeselectShapes; AHandled := true; exit; end else @@ -1290,6 +1383,11 @@ function TVectorShape.GetUsedTextures: ArrayOfBGRABitmap; setlength(result, nb); end; +function TVectorShape.GetAsMultishape: IVectorMultishape; +begin + result := nil; +end; + procedure TVectorShape.Transform(const AMatrix: TAffineMatrix); var zoom: Single; @@ -1635,6 +1733,11 @@ function TVectorShape.AllowShearTransform: boolean; result := true; end; +function TVectorShape.MultiFields: TVectorShapeFields; +begin + result := Fields; +end; + function TVectorShape.GetIsFront: boolean; begin result := Assigned(Container) and (Container.IndexOfShape(self)=Container.ShapeCount-1); @@ -2368,8 +2471,6 @@ function TVectorOriginal.InternalInsertShape(AShape: TVectorShape; if (AIndex < 0) or (AIndex > FShapes.Count) then raise exception.Create(rsIndexOutOfBounds); FShapes.Insert(AIndex, AShape); - inc(FLastShapeId); - AShape.Id := FLastShapeId; texs := AShape.GetUsedTextures; for i := 0 to high(texs) do AddTexture(texs[i]); AShape.OnChange := @OnShapeChange; @@ -2410,8 +2511,7 @@ function TVectorOriginal.InternalDeleteShapeRange(AStartIndex, ACount: integer): if Shape[i].FRemoving then raise exception.Create(errAlreadyRemovingShape); for i := AStartIndex to AStartIndex+ACount-1 do Shape[i].FRemoving := true; - for i := AStartIndex to AStartIndex+ACount-1 do - if Shape[i] = SelectedShape then DeselectShape; + for i := AStartIndex to AStartIndex+ACount-1 do DeselectShape(i); for i := AStartIndex+ACount-1 downto AStartIndex do begin s := Shape[i]; @@ -2426,11 +2526,26 @@ function TVectorOriginal.InternalDeleteShapeRange(AStartIndex, ACount: integer): DiscardFrozenShapes; end; +function TVectorOriginal.GetNewShapeId: integer; +begin + inc(FLastShapeId); + result := FLastShapeId; +end; + function TVectorOriginal.GetShape(AIndex: integer): TVectorShape; begin result := FShapes[AIndex]; end; +procedure TVectorOriginal.MultiSelection_SelectionChange(Sender: TObject); +begin + if FMultiselection = FSelectedShape then + begin + DiscardFrozenShapes; + NotifyEditorChange; + end; +end; + procedure TVectorOriginal.FreeDeletedShapes; var i: Integer; @@ -2443,11 +2558,15 @@ procedure TVectorOriginal.FreeDeletedShapes; procedure TVectorOriginal.OnShapeChange(ASender: TObject; ABounds: TRectF; ADiff: TVectorShapeDiff); var embed: TVectorOriginalShapeDiff; + idxShape: Integer; begin if ASender <> FSelectedShape then DiscardFrozenShapes; if DiffExpected and Assigned(ADiff) then begin - embed := TVectorOriginalShapeDiff.Create(IndexOfShape(ASender as TVectorShape), ADiff); + if ASender = FMultiselection then + idxShape := -2 + else idxShape := IndexOfShape(ASender as TVectorShape); + embed := TVectorOriginalShapeDiff.Create(idxShape, ADiff); ADiff := nil; NotifyChange(ABounds, embed); end else @@ -2526,12 +2645,22 @@ constructor TVectorOriginal.Create; FFrozenShapesComputed:= false; FLastTextureId:= EmptyTextureId; FLastShapeId:= 0; + if VectorMultiselectionFactory <> nil then + begin + FMultiselection := VectorMultiselectionFactory.Create(self); + FMultiselection.Id := -2; + FMultiselection.OnChange := @OnShapeChange; + FMultiselection.OnEditingChange := @OnShapeEditingChange; + FMultiselection.GetAsMultishape.SetOnSelectionChange(@MultiSelection_SelectionChange); + end + else FMultiselection := nil; end; destructor TVectorOriginal.Destroy; var i: Integer; begin + FMultiselection.Free; FSelectedShape := nil; for i := 0 to FShapes.Count-1 do FShapes[i].Free; @@ -2550,7 +2679,7 @@ procedure TVectorOriginal.Clear; begin if FShapes.Count > 0 then begin - FSelectedShape := nil; + DeselectShapes; for i := 0 to FShapes.Count-1 do FDeletedShapes.Add(FShapes[i]); FShapes.Clear; @@ -2619,6 +2748,12 @@ function TVectorOriginal.AddShape(AShape: TVectorShape; SelectShape(result); end; +function TVectorOriginal.AddShapes(AShapes: TVectorShapes): integer; +begin + result := ShapeCount; + InsertShapes(AShapes, result); +end; + procedure TVectorOriginal.InsertShape(AShape: TVectorShape; AIndex: integer); var newShapes: TVectorShapes; @@ -2629,7 +2764,7 @@ procedure TVectorOriginal.InsertShape(AShape: TVectorShape; AIndex: integer); newShapes.Free; end; -procedure TVectorOriginal.InsertShapeRange(AShapes: TVectorShapes; +procedure TVectorOriginal.InsertShapes(AShapes: TVectorShapes; AIndex: integer); begin ReplaceShapeRange(AIndex, 0, AShapes); @@ -2638,12 +2773,38 @@ procedure TVectorOriginal.InsertShapeRange(AShapes: TVectorShapes; function TVectorOriginal.RemoveShape(AShape: TVectorShape): boolean; var idx: LongInt; + multiSel: IVectorMultishape; + startIndex, endIndex, nextIndex, i, selCount: Integer; begin if AShape.FRemoving then exit(false); - idx := FShapes.IndexOf(AShape); - if idx = -1 then exit(false); - DeleteShapeRange(idx, 1); - result := true; + if (AShape = FMultiselection) and Assigned(FMultiselection) then + begin + multiSel := FMultiselection.GetAsMultishape; + selCount := multiSel.ShapeCount; + if selCount = 0 then exit; + endIndex := IndexOfShape(multiSel.GetShape(selCount-1)); + startIndex := endIndex; + i := selCount-2; + while i >= 0 do + begin + nextIndex := IndexOfShape(multiSel.GetShape(i)); + if nextIndex < startIndex-1 then + begin + DeleteShapeRange(startIndex, endIndex-startIndex+1); + endIndex := nextIndex; + startIndex := endIndex; + end else + startIndex := nextIndex; + dec(i); + end; + DeleteShapeRange(startIndex, endIndex-startIndex+1); + end else + begin + idx := FShapes.IndexOf(AShape); + if idx = -1 then exit(false); + DeleteShapeRange(idx, 1); + result := true; + end; end; procedure TVectorOriginal.DeleteShape(AIndex: integer); @@ -2676,6 +2837,16 @@ procedure TVectorOriginal.ReplaceShapeRange(AStartIndex: integer; begin if (AStartIndex < 0) or (AStartIndex+ACountBefore > ShapeCount) then raise exception.Create(rsIndexOutOfBounds); + + if Assigned(ANewShapes) then + for i := 0 to ANewShapes.Count-1 do + if ANewShapes[i] is VectorMultiselectionFactory then + raise exception.Create('Cannot add a multiselection as a shape'); + + if Assigned(ANewShapes) then + for i := 0 to ANewShapes.Count-1 do + ANewShapes[i].Id := GetNewShapeId; + if DiffExpected then begin if ACountBefore > 0 then @@ -2687,59 +2858,173 @@ procedure TVectorOriginal.ReplaceShapeRange(AStartIndex: integer; -1,-1); removed.Free; end else diff := nil; + rDelete := InternalDeleteShapeRange(AStartIndex, ACountBefore); rInsert := InternalInsertShapeRange(ANewShapes, AStartIndex); NotifyChange(TRectF.Union(rDelete,rInsert,True), diff); end; -procedure TVectorOriginal.SelectShape(AIndex: integer); +function TVectorOriginal.SelectShapes(AShapes: TVectorShapes): boolean; +begin + if AShapes.Count = 0 then result := DeselectShapes + else if AShapes.Count = 1 then result := SelectShape(AShapes[0]) + else + begin + FSelectedShape := FMultiselection; + if not FMultiselection.GetAsMultishape.SetShapes(AShapes) then + NotifyEditorChange; + end; +end; + +function TVectorOriginal.SelectShape(AIndex: integer; AToggle: boolean): boolean; begin - if AIndex=-1 then SelectShape(nil) + if AIndex=-1 then result := SelectShape(nil, AToggle) else begin if (AIndex < 0) or (AIndex >= FShapes.Count) then raise ERangeError.Create(rsIndexOutOfBounds); - SelectShape(FShapes[AIndex]); + result := SelectShape(FShapes[AIndex], AToggle); end; end; -procedure TVectorOriginal.SelectShape(AShape: TVectorShape); +function TVectorOriginal.SelectShape(AShape: TVectorShape; AToggle: boolean): boolean; var - prev: TVectorShape; + prevSel, newSel: TVectorShape; prevMode: TVectorShapeUsermode; + multiSel: IVectorMultishape; begin - if FSelectedShape <> AShape then + result := false; + //when selecting nothing + if AShape = nil then begin - if AShape <> nil then - if FShapes.IndexOf(AShape)=-1 then - raise exception.Create(rsShapeNotFound); - prev := FSelectedShape; - FSelectedShape := nil; - if Assigned(prev) then + if not AToggle then + result := DeselectShapes; + exit; + end; + + //selecting current selection + if AShape = FSelectedShape then + begin + if AToggle then + result := DeselectShapes; + exit; + end; + + //check selected shape exists + if AShape <> nil then + if FShapes.IndexOf(AShape)=-1 then + raise exception.Create(rsShapeNotFound); + + //case of modifying multiselection + if (FSelectedShape = FMultiselection) and Assigned(FMultiselection) and AToggle then + begin + multiSel := FSelectedShape.GetAsMultishape; + if multiSel.ContainsShape(AShape) then begin - prevMode := prev.Usermode; - prev.Usermode := vsuEdit; + multiSel.RemoveShape(AShape); + if multiSel.ShapeCount = 0 then + begin + FSelectedShape := nil; + exit(true); + end else + if multiSel.ShapeCount > 1 then + exit(true) else + begin + SelectShape(multiSel.GetShape(0)); + exit(true); + end; end else - prevMode := vsuEdit; - if Assigned(AShape) and (prevMode = vsuEditBackFill) and (prevMode in AShape.Usermodes) and - AShape.BackFill.IsEditable then AShape.Usermode:= prevMode; - if Assigned(AShape) and (prevMode = vsuEditPenFill) and (prevMode in AShape.Usermodes) and - AShape.PenFill.IsEditable then AShape.Usermode:= prevMode; - if Assigned(AShape) and (prevMode = vsuEditOutlineFill) and (prevMode in AShape.Usermodes) and - AShape.OutlineFill.IsEditable then AShape.Usermode:= prevMode; - if Assigned(AShape) and (prevMode = vsuEditText) and (prevMode in AShape.Usermodes) then - AShape.Usermode := prevMode; - FSelectedShape := AShape; - DiscardFrozenShapes; - NotifyEditorChange; - if Assigned(FOnSelectShape) then - FOnSelectShape(self, FSelectedShape, prev); + begin + multiSel.AddShape(AShape); + exit(true); + end; + end; + + //changing selection completely + prevSel := FSelectedShape; + if Assigned(prevSel) then + begin + prevMode := prevSel.Usermode; + prevSel.Usermode := vsuEdit; + end else + prevMode := vsuEdit; + + //becomes a multiselection + if AToggle and (prevSel <> nil) and Assigned(FMultiselection) then + begin + multiSel := FMultiselection.GetAsMultishape; + multiSel.ClearShapes; + multiSel.AddShape(prevSel); + multiSel.AddShape(AShape); + newSel := FMultiselection; + end else + begin + //otherwise simple selection + newSel := AShape; end; + + //transfering user mode + if (prevMode = vsuEditBackFill) and (prevMode in newSel.Usermodes) and + newSel.BackFill.IsEditable then newSel.Usermode:= prevMode; + if (prevMode = vsuEditPenFill) and (prevMode in newSel.Usermodes) and + newSel.PenFill.IsEditable then newSel.Usermode:= prevMode; + if (prevMode = vsuEditOutlineFill) and (prevMode in newSel.Usermodes) and + newSel.OutlineFill.IsEditable then newSel.Usermode:= prevMode; + if (prevMode = vsuEditText) and (prevMode in newSel.Usermodes) then + newSel.Usermode := prevMode; + + FSelectedShape := newSel; + DiscardFrozenShapes; + NotifyEditorChange; + if Assigned(FOnSelectShape) then + FOnSelectShape(self, FSelectedShape, prevSel); + + if (prevSel = FMultiselection) and Assigned(FMultiselection) then + FMultiselection.GetAsMultishape.ClearShapes; +end; + +function TVectorOriginal.DeselectShapes: boolean; +var + prev: TVectorShape; +begin + if SelectedShape = nil then exit(false); + + prev := SelectedShape; + SelectedShape.Usermode := vsuEdit; + FSelectedShape := nil; + + if (prev = FMultiselection) and Assigned(FMultiselection) then + FMultiselection.GetAsMultishape.ClearShapes; + + DiscardFrozenShapes; + NotifyEditorChange; + + if Assigned(FOnSelectShape) then + FOnSelectShape(self, nil, prev); + result := true; end; -procedure TVectorOriginal.DeselectShape; +procedure TVectorOriginal.DeselectShape(AIndex: integer); begin - SelectShape(nil); + if (AIndex >= 0) and (AIndex < ShapeCount) then + DeselectShape(Shape[AIndex]); +end; + +procedure TVectorOriginal.DeselectShape(AShape: TVectorShape); +var + multiSel: IVectorMultishape; +begin + if AShape = SelectedShape then DeselectShapes else + begin + if (SelectedShape = FMultiselection) and Assigned(FMultiselection) then + begin + multiSel := SelectedShape.GetAsMultishape; + if multiSel.ContainsShape(AShape) then + multiSel.RemoveShape(AShape); + if multiSel.ShapeCount = 1 then + SelectShape(multiSel.GetShape(0)); + end; + end; end; function TVectorOriginal.GetShapesCost: integer; @@ -2761,7 +3046,7 @@ function TVectorOriginal.PreferDraftMode(AEditor: TBGRAOriginalEditor; const AMa result := false; end; -function TVectorOriginal.MouseClick(APoint: TPointF; ARadius: single): boolean; +function TVectorOriginal.MouseClick(APoint: TPointF; ARadius: single; AToggle: boolean): boolean; var i: LongInt; begin @@ -2770,7 +3055,7 @@ function TVectorOriginal.MouseClick(APoint: TPointF; ARadius: single): boolean; begin if SelectedShape <> FShapes[i] then begin - SelectShape(i); + SelectShape(i, AToggle); exit(true); end else exit(false); @@ -2780,14 +3065,14 @@ function TVectorOriginal.MouseClick(APoint: TPointF; ARadius: single): boolean; begin if SelectedShape <> FShapes[i] then begin - SelectShape(i); + SelectShape(i, AToggle); exit(true); end else exit(false); end; - if SelectedShape <> nil then + if (SelectedShape <> nil) and not AToggle then begin - DeselectShape; + DeselectShapes; exit(true); end else exit(false); @@ -2797,54 +3082,123 @@ procedure TVectorOriginal.Render(ADest: TBGRABitmap; ARenderOffset: TPoint; AMat ADraft: boolean); var i: Integer; - idxSelected: LongInt; - clipRectF,allRectF: TRectF; + idxSelected, newUnfrozenRangeStart, newUnfrozenRangeEnd: LongInt; + shapeRectF, clipRectF, allRectF: TRectF; mOfs: TAffineMatrix; + multiSel: IVectorMultishape; + ofsRange: TPoint; + oldClip: TRect; begin - if AMatrix <> FFrozenShapeMatrix then DiscardFrozenShapes; - idxSelected := FShapes.IndexOf(FSelectedShape); - if idxSelected = -1 then + if FSelectedShape <> FMultiselection then begin - FSelectedShape := nil; - DiscardFrozenShapes; + idxSelected := FShapes.IndexOf(FSelectedShape); + if idxSelected = -1 then + begin + FSelectedShape := nil; + newUnfrozenRangeStart := 0; + newUnfrozenRangeEnd := ShapeCount; + end else + begin + newUnfrozenRangeStart := idxSelected; + newUnfrozenRangeEnd := idxSelected+1; + end; + end else + begin + multiSel := FMultiselection.GetAsMultishape; + if multiSel.ShapeCount = 0 then + begin + FSelectedShape := nil; + newUnfrozenRangeStart := 0; + newUnfrozenRangeEnd := ShapeCount; + end; + newUnfrozenRangeStart := IndexOfShape(multiSel.BackShape); + newUnfrozenRangeEnd := IndexOfShape(multiSel.FrontShape)+1; end; + if (newUnfrozenRangeStart <> FUnfrozenRangeStart) or + (newUnfrozenRangeEnd <> FUnfrozenRangeEnd) or + (AMatrix <> FFrozenShapeMatrix) then + DiscardFrozenShapes; with ADest.ClipRect do clipRectF := RectF(Left,Top,Right,Bottom); mOfs := AffineMatrixTranslation(ARenderOffset.X,ARenderOffset.Y)*AMatrix; if FFrozenShapesComputed then begin - ADest.PutImage(ARenderOffset.X-FFrozenShapesRenderOffset.X, - ARenderOffset.Y-FFrozenShapesRenderOffset.Y, - FFrozenShapesUnderSelection, dmSet); - if FSelectedShape.GetRenderBounds(ADest.ClipRect, mOfs, []).IntersectsWith(clipRectF) then - FSelectedShape.Render(ADest, ARenderOffset, AMatrix, ADraft); - ADest.PutImage(ARenderOffset.X-FFrozenShapesRenderOffset.X, - ARenderOffset.Y-FFrozenShapesRenderOffset.Y, - FFrozenShapesOverSelection, dmDrawWithTransparency); + if Assigned(FFrozenShapesUnderSelection) then + ADest.PutImage(ARenderOffset.X-FFrozenShapesRenderOffset.X+FFrozenShapesUnderBounds.Left, + ARenderOffset.Y-FFrozenShapesRenderOffset.Y+FFrozenShapesUnderBounds.Top, + FFrozenShapesUnderSelection, dmSet); + for i := FUnfrozenRangeStart to FUnfrozenRangeEnd-1 do + begin + shapeRectF := FShapes[i].GetRenderBounds(ADest.ClipRect, mOfs, []); + if shapeRectF.IntersectsWith(clipRectF) then + begin + with shapeRectF do + oldClip := ADest.IntersectClip(rect(floor(Left), floor(Top), ceil(Right), ceil(Bottom))); + FShapes[i].Render(ADest, ARenderOffset, AMatrix, ADraft); + ADest.ClipRect := oldClip; + end; + end; + if Assigned(FFrozenShapesOverSelection) then + ADest.PutImage(ARenderOffset.X-FFrozenShapesRenderOffset.X+FFrozenShapesOverBounds.Left, + ARenderOffset.Y-FFrozenShapesRenderOffset.Y+FFrozenShapesOverBounds.Top, + FFrozenShapesOverSelection, dmDrawWithTransparency); end else begin - if idxSelected <> -1 then + if (newUnfrozenRangeStart > 0) or (newUnfrozenRangeEnd < ShapeCount) then begin allRectF := rectF(0,0,ADest.Width,ADest.Height); - if idxSelected > 0 then + FUnfrozenRangeStart := newUnfrozenRangeStart; + FUnfrozenRangeEnd := newUnfrozenRangeEnd; + if FUnfrozenRangeStart > 0 then begin FreeAndNil(FFrozenShapesUnderSelection); - FFrozenShapesUnderSelection := TBGRABitmap.Create(ADest.Width,ADest.Height); - for i:= 0 to idxSelected-1 do - if FShapes[i].GetRenderBounds(rect(0,0,ADest.Width,ADest.Height), mOfs, []).IntersectsWith(allRectF) then - FShapes[i].Render(FFrozenShapesUnderSelection, ARenderOffset, AMatrix, false); - ADest.PutImage(0,0,FFrozenShapesUnderSelection, dmSet); + FFrozenShapesUnderBounds := GetRenderBounds(rect(0,0,ADest.Width,ADest.Height), mOfs, + 0, FUnfrozenRangeStart-1); + FFrozenShapesUnderBounds.Intersect(rect(0,0,ADest.Width,ADest.Height)); + FFrozenShapesUnderSelection := TBGRABitmap.Create(FFrozenShapesUnderBounds.Width, FFrozenShapesUnderBounds.Height); + ofsRange := Point(ARenderOffset.X - FFrozenShapesUnderBounds.Left, + ARenderOffset.Y - FFrozenShapesUnderBounds.Top); + for i:= 0 to FUnfrozenRangeStart-1 do + begin + shapeRectF := FShapes[i].GetRenderBounds(rect(0,0,ADest.Width,ADest.Height), mOfs, []); + if shapeRectF.IntersectsWith(allRectF) then + begin + shapeRectF.Offset(-FFrozenShapesUnderBounds.Left, -FFrozenShapesUnderBounds.Top); + with shapeRectF do + oldClip := FFrozenShapesUnderSelection.IntersectClip(rect(floor(Left), floor(Top), ceil(Right), ceil(Bottom))); + FShapes[i].Render(FFrozenShapesUnderSelection, ofsRange, AMatrix, false); + FFrozenShapesUnderSelection.ClipRect := oldClip; + end; + end; + ADest.PutImage(FFrozenShapesUnderBounds.Left, FFrozenShapesUnderBounds.Top, + FFrozenShapesUnderSelection, dmSet); end; - if FSelectedShape.GetRenderBounds(ADest.ClipRect, mOfs, []).IntersectsWith(clipRectF) then - FSelectedShape.Render(ADest, ARenderOffset, AMatrix, ADraft); - if idxSelected < FShapes.Count-1 then + for i := FUnfrozenRangeStart to FUnfrozenRangeEnd-1 do + if FShapes[i].GetRenderBounds(ADest.ClipRect, mOfs, []).IntersectsWith(clipRectF) then + FShapes[i].Render(ADest, ARenderOffset, AMatrix, ADraft); + if FUnfrozenRangeEnd < FShapes.Count then begin FreeAndNil(FFrozenShapesOverSelection); - FFrozenShapesOverSelection := TBGRABitmap.Create(ADest.Width,ADest.Height); - for i:= idxSelected+1 to FShapes.Count-1 do - if FShapes[i].GetRenderBounds(rect(0,0,ADest.Width,ADest.Height), mOfs, []).IntersectsWith(allRectF) then - FShapes[i].Render(FFrozenShapesOverSelection, ARenderOffset, AMatrix, false); - ADest.PutImage(0,0,FFrozenShapesOverSelection, dmDrawWithTransparency); + FFrozenShapesOverBounds := GetRenderBounds(rect(0,0,ADest.Width,ADest.Height), AMatrix, + FUnfrozenRangeEnd, FShapes.Count-1); + FFrozenShapesOverBounds.Intersect(rect(0,0,ADest.Width,ADest.Height)); + FFrozenShapesOverSelection := TBGRABitmap.Create(FFrozenShapesOverBounds.Width, FFrozenShapesOverBounds.Height); + ofsRange := Point(ARenderOffset.X - FFrozenShapesOverBounds.Left, + ARenderOffset.Y - FFrozenShapesOverBounds.Top); + for i:= FUnfrozenRangeEnd to FShapes.Count-1 do + begin + shapeRectF := FShapes[i].GetRenderBounds(rect(0,0,ADest.Width,ADest.Height), mOfs, []); + if shapeRectF.IntersectsWith(allRectF) then + begin + shapeRectF.Offset(-FFrozenShapesOverBounds.Left, -FFrozenShapesOverBounds.Top); + with shapeRectF do + oldClip := FFrozenShapesOverSelection.IntersectClip(rect(floor(Left), floor(Top), ceil(Right), ceil(Bottom))); + FShapes[i].Render(FFrozenShapesOverSelection, ofsRange, AMatrix, false); + FFrozenShapesOverSelection.ClipRect := oldClip; + end; + end; + ADest.PutImage(FFrozenShapesOverBounds.Left, FFrozenShapesOverBounds.Top, + FFrozenShapesOverSelection, dmDrawWithTransparency); end; FFrozenShapesRenderOffset := ARenderOffset; FFrozenShapesComputed := true; @@ -2864,7 +3218,8 @@ procedure TVectorOriginal.ConfigureEditor(AEditor: TBGRAOriginalEditor); inherited ConfigureEditor(AEditor); if Assigned(FSelectedShape) then begin - if FShapes.IndexOf(FSelectedShape)=-1 then + if (FShapes.IndexOf(FSelectedShape)=-1) and + (FSelectedShape <> FMultiselection) then begin FSelectedShape := nil; DiscardFrozenShapes; @@ -3001,10 +3356,7 @@ procedure TVectorOriginal.LoadFromStorage(AStorage: TBGRACustomOriginalStorage); end; for i := 0 to ShapeCount-1 do if Shape[i].Id = 0 then - begin - inc(FLastShapeId); - Shape[i].Id := FLastShapeId; - end; + Shape[i].Id := GetNewShapeId; NotifyChange; end; From e308e2e6fe97825f536d3323e0f27260174fbc6c Mon Sep 17 00:00:00 2001 From: johann Date: Thu, 26 Mar 2020 13:10:15 +0100 Subject: [PATCH 40/53] escape to exit edit text/shape --- lazpaint/tools/utoolvectorial.pas | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lazpaint/tools/utoolvectorial.pas b/lazpaint/tools/utoolvectorial.pas index 7ae4c33a..2679faac 100644 --- a/lazpaint/tools/utoolvectorial.pas +++ b/lazpaint/tools/utoolvectorial.pas @@ -1177,6 +1177,14 @@ function TEditShapeTool.DoToolKeyDown(var key: Word): TRect; begin GetVectorOriginal.RemoveShape(GetVectorOriginal.SelectedShape); key := 0; + end else + if (key = VK_ESCAPE) and Assigned(GetVectorOriginal.SelectedShape) then + begin + if GetVectorOriginal.SelectedShape.Usermode = vsuEditText then + GetVectorOriginal.SelectedShape.Usermode := vsuEdit + else + GetVectorOriginal.DeselectShapes; + key := 0; end; end; finally From e600dd0503d5484963733e53d93c1c7025dc1cfc Mon Sep 17 00:00:00 2001 From: johann Date: Thu, 26 Mar 2020 14:12:21 +0100 Subject: [PATCH 41/53] tool layer bounds based on align bounds --- lazpaint/tools/utoollayer.pas | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/lazpaint/tools/utoollayer.pas b/lazpaint/tools/utoollayer.pas index 33906e6b..c9f8980b 100644 --- a/lazpaint/tools/utoollayer.pas +++ b/lazpaint/tools/utoollayer.pas @@ -197,9 +197,14 @@ procedure TToolMoveLayer.NeedLayerBounds; begin if UseOriginal then begin - FLayerBounds := Manager.Image.LayerOriginal[idx].GetRenderBounds( - Rect(-VeryBigValue,-VeryBigValue,VeryBigValue,VeryBigValue), - AffineMatrixIdentity); + if Manager.Image.LayerOriginal[idx] is TVectorOriginal then + FLayerBounds := TVectorOriginal(Manager.Image.LayerOriginal[idx]).GetAlignBounds( + Rect(-VeryBigValue,-VeryBigValue,VeryBigValue,VeryBigValue), + AffineMatrixIdentity) + else + FLayerBounds := Manager.Image.LayerOriginal[idx].GetRenderBounds( + Rect(-VeryBigValue,-VeryBigValue,VeryBigValue,VeryBigValue), + AffineMatrixIdentity); if FLayerBounds.Left = -VeryBigValue then FLayerBounds.Left := 0; if FLayerBounds.Top = -VeryBigValue then FLayerBounds.Top := 0; if FLayerBounds.Right = VeryBigValue then FLayerBounds.Right := Manager.Image.Width; @@ -722,9 +727,14 @@ function TToolTransformLayer.Render(VirtualScreen: TBGRABitmap; begin if Manager.Image.LayerOriginalDefined[idx] then begin - FOriginalBounds := Manager.Image.LayerOriginal[idx].GetRenderBounds( - Rect(-VeryBigValue,-VeryBigValue,VeryBigValue,VeryBigValue), - AffineMatrixIdentity); + if Manager.Image.LayerOriginal[idx] is TVectorOriginal then + FOriginalBounds := TVectorOriginal(Manager.Image.LayerOriginal[idx]).GetAlignBounds( + Rect(-VeryBigValue,-VeryBigValue,VeryBigValue,VeryBigValue), + AffineMatrixIdentity) + else + FOriginalBounds := Manager.Image.LayerOriginal[idx].GetRenderBounds( + Rect(-VeryBigValue,-VeryBigValue,VeryBigValue,VeryBigValue), + AffineMatrixIdentity); if FOriginalBounds.Left = -VeryBigValue then FOriginalBounds.Left := 0; if FOriginalBounds.Top = -VeryBigValue then FOriginalBounds.Top := 0; if FOriginalBounds.Right = VeryBigValue then FOriginalBounds.Right := Manager.Image.Width; From e12503b849023a1770da3a0aa423777cc7850181 Mon Sep 17 00:00:00 2001 From: johann Date: Fri, 27 Mar 2020 08:29:30 +0100 Subject: [PATCH 42/53] script: get version --- lazpaint/lazpaintdialogs.inc | 11 +++++++++++ lazpaint/lazpaintinstance.pas | 2 ++ scripts/display_version.py | 10 ++++++++++ scripts/lazpaint/command.py | 2 ++ 4 files changed, 25 insertions(+) create mode 100644 scripts/display_version.py diff --git a/lazpaint/lazpaintdialogs.inc b/lazpaint/lazpaintdialogs.inc index 0652dcfb..ff0320f4 100644 --- a/lazpaint/lazpaintdialogs.inc +++ b/lazpaint/lazpaintdialogs.inc @@ -206,6 +206,17 @@ begin result := srCancelledByUser; end; +function TLazPaintInstance.ScriptLazPaintGetVersion(AVars: TVariableSet): TScriptResult; +var + resList: TScriptVariableReference; +begin + resList := AVars.AddIntegerList('Result'); + AVars.AppendInteger(resList, LazPaintVersion div 1000000); + AVars.AppendInteger(resList, (LazPaintVersion div 10000) mod 100); + AVars.AppendInteger(resList, (LazPaintVersion div 100) mod 100); + result := srOk; +end; + function TLazPaintInstance.ScriptShowDirectoryDialog(AVars: TVariableSet): TScriptResult; var chosenDir: string; diff --git a/lazpaint/lazpaintinstance.pas b/lazpaint/lazpaintinstance.pas index 9451e137..748d1e78 100644 --- a/lazpaint/lazpaintinstance.pas +++ b/lazpaint/lazpaintinstance.pas @@ -56,6 +56,7 @@ TLazPaintInstance = class(TLazPaintCustomInstance) function ScriptImageCanvasSize(AVars: TVariableSet): TScriptResult; function ScriptImageRepeat(AVars: TVariableSet): TScriptResult; function ScriptImageResample(AParams: TVariableSet): TScriptResult; + function ScriptLazPaintGetVersion(AVars: TVariableSet): TScriptResult; function ScriptShowDirectoryDialog(AVars: TVariableSet): TScriptResult; procedure SelectionInstanceOnRun(AInstance: TLazPaintCustomInstance); procedure ToolFillChanged(Sender: TObject); @@ -369,6 +370,7 @@ procedure TLazPaintInstance.RegisterScripts(ARegister: Boolean); ScriptContext.RegisterScriptFunction('ShowMessage',@ScriptShowMessage,ARegister); ScriptContext.RegisterScriptFunction('ShowDirectoryDialog',@ScriptShowDirectoryDialog,ARegister); ScriptContext.RegisterScriptFunction('InputBox',@ScriptInputBox,ARegister); + ScriptContext.RegisterScriptFunction('LazPaintGetVersion',@ScriptLazPaintGetVersion,ARegister); end; function TLazPaintInstance.ScriptFileGetTemporaryName(AVars: TVariableSet): TScriptResult; diff --git a/scripts/display_version.py b/scripts/display_version.py new file mode 100644 index 00000000..1e1aca2d --- /dev/null +++ b/scripts/display_version.py @@ -0,0 +1,10 @@ +# Version + +from lazpaint import command, dialog +import sys + +lazpaint_version = command.get_version() +python_version = sys.version_info + +dialog.show_message("Python version " + str(python_version[0]) + "." + str(python_version[1]) + "." + str(python_version[2]) + ", " + "LazPaint version " + str(lazpaint_version[0]) + "." + str(lazpaint_version[1]) + "." + str(lazpaint_version[2]) ) + diff --git a/scripts/lazpaint/command.py b/scripts/lazpaint/command.py index 979b38bf..029e73bf 100644 --- a/scripts/lazpaint/command.py +++ b/scripts/lazpaint/command.py @@ -24,3 +24,5 @@ def send(command: str, **keywords): else: return +def get_version(): # (major, minor, revision) + return send("LazPaintGetVersion?") From 5d11132756fd4a550892f61a26cdeca394678271 Mon Sep 17 00:00:00 2001 From: johann Date: Fri, 27 Mar 2020 10:29:44 +0100 Subject: [PATCH 43/53] vector tool using generic shape class --- lazpaint/tools/utoolfloodfill.pas | 8 +++- lazpaint/tools/utoolphong.pas | 6 +-- lazpaint/tools/utoolpolygon.pas | 53 +++++++++--------------- lazpaint/tools/utoolselect.pas | 12 +++--- lazpaint/tools/utooltext.pas | 6 +-- lazpaint/tools/utoolvectorial.pas | 69 ++++++++++++++++++++----------- 6 files changed, 83 insertions(+), 71 deletions(-) diff --git a/lazpaint/tools/utoolfloodfill.pas b/lazpaint/tools/utoolfloodfill.pas index 8018688e..ddb3bc92 100644 --- a/lazpaint/tools/utoolfloodfill.pas +++ b/lazpaint/tools/utoolfloodfill.pas @@ -25,6 +25,7 @@ TToolFloodFill = class(TGenericTool) TToolGradient = class(TVectorialTool) protected + function ShapeClass: TVectorShapeAny; override; function CreateShape: TVectorShape; override; procedure DrawCustomShape(ADest: TBGRABitmap; AMatrix: TAffineMatrix; ADraft: boolean); override; procedure AssignShapeStyle({%H-}AMatrix: TAffineMatrix; {%H-}AAlwaysFit: boolean); override; @@ -44,9 +45,14 @@ implementation { TToolGradient } +function TToolGradient.ShapeClass: TVectorShapeAny; +begin + result := TRectShape; +end; + function TToolGradient.CreateShape: TVectorShape; begin - result := TRectShape.Create(nil); + result := inherited CreateShape; result.PenFill.Clear; result.BackFill.SetGradient(TBGRALayerGradientOriginal.Create,true); result.Usermode := vsuEditBackFill; diff --git a/lazpaint/tools/utoolphong.pas b/lazpaint/tools/utoolphong.pas index 91480117..b003124b 100644 --- a/lazpaint/tools/utoolphong.pas +++ b/lazpaint/tools/utoolphong.pas @@ -16,7 +16,7 @@ TToolPhong = class(TVectorialTool) FMatrix: TAffineMatrix; procedure ShapeChange({%H-}ASender: TObject; ABounds: TRectF; ADiff: TVectorShapeDiff); override; procedure AssignShapeStyle(AMatrix: TAffineMatrix; AAlwaysFit: boolean); override; - function CreateShape: TVectorShape; override; + function ShapeClass: TVectorShapeAny; override; public constructor Create(AManager: TToolManager); override; function GetContextualToolbars: TContextualToolbars; override; @@ -61,9 +61,9 @@ procedure TToolPhong.AssignShapeStyle(AMatrix: TAffineMatrix; AAlwaysFit: boolea end; end; -function TToolPhong.CreateShape: TVectorShape; +function TToolPhong.ShapeClass: TVectorShapeAny; begin - result := TPhongShape.Create(nil); + result := TPhongShape; end; initialization diff --git a/lazpaint/tools/utoolpolygon.pas b/lazpaint/tools/utoolpolygon.pas index cc103bf6..b7e90c4b 100644 --- a/lazpaint/tools/utoolpolygon.pas +++ b/lazpaint/tools/utoolpolygon.pas @@ -16,19 +16,15 @@ interface TToolRectangle = class(TVectorialTool) protected - function CreateShape: TVectorShape; override; - public - function GetContextualToolbars: TContextualToolbars; override; + function ShapeClass: TVectorShapeAny; override; end; { TToolEllipse } TToolEllipse = class(TVectorialTool) protected - function CreateShape: TVectorShape; override; + function ShapeClass: TVectorShapeAny; override; function GetGridMatrix: TAffineMatrix; override; - public - function GetContextualToolbars: TContextualToolbars; override; end; { TToolPolygon } @@ -36,6 +32,7 @@ TToolEllipse = class(TVectorialTool) TToolPolygon = class(TVectorialTool) protected initiallyClosed : boolean; + function ShapeClass: TVectorShapeAny; override; function CreateShape: TVectorShape; override; function ShouldCloseShape: boolean; virtual; procedure UpdateManagerCloseShape({%H-}AClose: boolean); virtual; @@ -47,7 +44,6 @@ TToolPolygon = class(TVectorialTool) public function ToolUp: TRect; override; function ToolKeyPress(var key: TUTF8Char): TRect; override; - function GetContextualToolbars: TContextualToolbars; override; end; { TToolPolyline } @@ -73,13 +69,13 @@ TToolSpline = class(TToolPolygon) function GetCurrentMode: TToolSplineMode; procedure SetCurrentMode(AValue: TToolSplineMode); protected + function ShapeClass: TVectorShapeAny; override; function CreateShape: TVectorShape; override; procedure AssignShapeStyle(AMatrix: TAffineMatrix; AAlwaysFit: boolean); override; procedure UpdateUserMode; override; public constructor Create(AManager: TToolManager); override; function ToolKeyPress(var key: TUTF8Char): TRect; override; - function GetContextualToolbars: TContextualToolbars; override; property CurrentMode: TToolSplineMode read GetCurrentMode write SetCurrentMode; end; @@ -166,9 +162,9 @@ function TToolPolyline.GetContextualToolbars: TContextualToolbars; { TToolEllipse } -function TToolEllipse.CreateShape: TVectorShape; +function TToolEllipse.ShapeClass: TVectorShapeAny; begin - result := TEllipseShape.Create(nil); + result := TEllipseShape; end; function TToolEllipse.GetGridMatrix: TAffineMatrix; @@ -176,21 +172,11 @@ function TToolEllipse.GetGridMatrix: TAffineMatrix; Result:= AffineMatrixScale(0.5, 0.5); end; -function TToolEllipse.GetContextualToolbars: TContextualToolbars; -begin - Result:= [ctPenFill,ctBackFill,ctShape,ctPenWidth,ctPenStyle]; -end; - { TToolRectangle } -function TToolRectangle.CreateShape: TVectorShape; -begin - result := TRectShape.Create(nil); -end; - -function TToolRectangle.GetContextualToolbars: TContextualToolbars; +function TToolRectangle.ShapeClass: TVectorShapeAny; begin - Result:= [ctPenFill,ctBackFill,ctShape,ctPenWidth,ctPenStyle,ctJoinStyle]; + result := TRectShape; end; { TToolSpline } @@ -209,6 +195,11 @@ procedure TToolSpline.SetCurrentMode(AValue: TToolSplineMode); UpdateUserMode; end; +function TToolSpline.ShapeClass: TVectorShapeAny; +begin + result := TCurveShape; +end; + procedure TToolSpline.UpdateUserMode; var c: TCurveShape; @@ -233,8 +224,7 @@ procedure TToolSpline.UpdateUserMode; function TToolSpline.CreateShape: TVectorShape; begin - result := TCurveShape.Create(nil); - result.Usermode := vsuCreate; + result := inherited CreateShape; TCurveShape(result).CosineAngle:= EasyBezierMinimumDotProduct; if not FCurveModeHintShown then begin @@ -269,16 +259,16 @@ function TToolSpline.ToolKeyPress(var key: TUTF8Char): TRect; end; end; -function TToolSpline.GetContextualToolbars: TContextualToolbars; +{ TToolPolygon } + +function TToolPolygon.ShapeClass: TVectorShapeAny; begin - Result:= [ctPenFill,ctBackFill,ctShape,ctCloseShape,ctPenWidth,ctPenStyle,ctLineCap,ctSplineStyle]; + result := TPolylineShape; end; -{ TToolPolygon } - function TToolPolygon.CreateShape: TVectorShape; begin - result := TPolylineShape.Create(nil); + result := inherited CreateShape; initiallyClosed := ShouldCloseShape; end; @@ -366,11 +356,6 @@ function TToolPolygon.RoundCoordinate(constref ptF: TPointF): TPointF; result := ptF; end; -function TToolPolygon.GetContextualToolbars: TContextualToolbars; -begin - Result:= [ctPenFill,ctBackFill,ctShape,ctCloseShape,ctPenWidth,ctPenStyle,ctJoinStyle,ctLineCap]; -end; - initialization RegisterTool(ptRect,TToolRectangle); diff --git a/lazpaint/tools/utoolselect.pas b/lazpaint/tools/utoolselect.pas index 2828d566..5e14ede3 100644 --- a/lazpaint/tools/utoolselect.pas +++ b/lazpaint/tools/utoolselect.pas @@ -29,7 +29,7 @@ TVectorialSelectTool = class(TVectorialTool) TToolSelectRect = class(TVectorialSelectTool) protected - function CreateShape: TVectorShape; override; + function ShapeClass: TVectorShapeAny; override; public function Render(VirtualScreen: TBGRABitmap; {%H-}VirtualScreenWidth, {%H-}VirtualScreenHeight: integer; BitmapToVirtualScreen: TBitmapToVirtualScreenFunction):TRect; override; function GetContextualToolbars: TContextualToolbars; override; @@ -39,7 +39,7 @@ TToolSelectRect = class(TVectorialSelectTool) TToolSelectEllipse = class(TVectorialSelectTool) protected - function CreateShape: TVectorShape; override; + function ShapeClass: TVectorShapeAny; override; function GetGridMatrix: TAffineMatrix; override; public function Render(VirtualScreen: TBGRABitmap; {%H-}VirtualScreenWidth, {%H-}VirtualScreenHeight: integer; BitmapToVirtualScreen: TBitmapToVirtualScreenFunction):TRect; override; @@ -266,9 +266,9 @@ function TVectorialSelectTool.GetContextualToolbars: TContextualToolbars; { TToolSelectRect } -function TToolSelectRect.CreateShape: TVectorShape; +function TToolSelectRect.ShapeClass: TVectorShapeAny; begin - result := TRectShape.Create(nil); + result := TRectShape; end; function TToolSelectRect.Render(VirtualScreen: TBGRABitmap; VirtualScreenWidth, @@ -309,9 +309,9 @@ function TToolSelectRect.GetContextualToolbars: TContextualToolbars; { TToolSelectEllipse } -function TToolSelectEllipse.CreateShape: TVectorShape; +function TToolSelectEllipse.ShapeClass: TVectorShapeAny; begin - result := TEllipseShape.Create(nil); + result := TEllipseShape; end; function TToolSelectEllipse.GetGridMatrix: TAffineMatrix; diff --git a/lazpaint/tools/utooltext.pas b/lazpaint/tools/utooltext.pas index 3888dce1..64b74ed1 100644 --- a/lazpaint/tools/utooltext.pas +++ b/lazpaint/tools/utooltext.pas @@ -18,7 +18,7 @@ TToolText = class(TVectorialTool) FPrevShadow: boolean; FPrevShadowOffset: TPoint; FPrevShadowRadius: single; - function CreateShape: TVectorShape; override; + function ShapeClass: TVectorShapeAny; override; function AlwaysRasterizeShape: boolean; override; procedure IncludeShadowBounds(var ARect: TRect); function GetCustomShapeBounds(ADestBounds: TRect; AMatrix: TAffineMatrix; ADraft: boolean): TRect; override; @@ -43,9 +43,9 @@ implementation { TToolText } -function TToolText.CreateShape: TVectorShape; +function TToolText.ShapeClass: TVectorShapeAny; begin - result := TTextShape.Create(nil); + result := TTextShape; end; function TToolText.AlwaysRasterizeShape: boolean; diff --git a/lazpaint/tools/utoolvectorial.pas b/lazpaint/tools/utoolvectorial.pas index 2679faac..42c0c6ae 100644 --- a/lazpaint/tools/utoolvectorial.pas +++ b/lazpaint/tools/utoolvectorial.pas @@ -40,7 +40,8 @@ TVectorialTool = class(TGenericTool) FLastShapeTransform: TAffineMatrix; FUseOriginal: boolean; function AlwaysRasterizeShape: boolean; virtual; - function CreateShape: TVectorShape; virtual; abstract; + function CreateShape: TVectorShape; virtual; + function ShapeClass: TVectorShapeAny; virtual; abstract; function UseOriginal: boolean; virtual; function HasBrush: boolean; virtual; function GetCustomShapeBounds(ADestBounds: TRect; AMatrix: TAffineMatrix; {%H-}ADraft: boolean): TRect; virtual; @@ -93,6 +94,7 @@ TVectorialTool = class(TGenericTool) function ToolCommand(ACommand: TToolCommand): boolean; override; function ToolProvideCommand(ACommand: TToolCommand): boolean; override; function SuggestGradientBox: TAffineBox; override; + function GetContextualToolbars: TContextualToolbars; override; function Render(VirtualScreen: TBGRABitmap; {%H-}VirtualScreenWidth, {%H-}VirtualScreenHeight: integer; BitmapToVirtualScreen: TBitmapToVirtualScreenFunction):TRect; override; property IsIdle: boolean read GetIsIdle; property IsHandDrawing: boolean read GetIsHandDrawing; @@ -225,6 +227,35 @@ function ToolSplineModeFromShape(AShape: TVectorShape): TToolSplineMode; end; end; +function ContextualToolbarsFromShape(AShapeClass: TVectorShapeAny; AShape: TVectorShape): TContextualToolbars; +var + f: TVectorShapeFields; +begin + result:= [ctPenFill, ctBackFill]; + if Assigned(AShape) then + f := AShape.MultiFields + else f := AShapeClass.Fields; + if vsfPenWidth in f then result += [ctPenWidth]; + if vsfPenStyle in f then result += [ctPenStyle]; + if vsfJoinStyle in f then result += [ctJoinStyle]; + if [vsfPenStyle,vsfPenFill,vsfBackFill] <= f then result += [ctShape]; + if vsfOutlineFill in f then + begin + result += [ctOutlineFill]; + if not (vsfBackFill in f) then result -= [ctBackFill]; + end; + if vsfOutlineWidth in f then result += [ctOutlineWidth]; + + if AShapeClass = TCurveShape then result := result + [ctShape,ctCloseShape,ctLineCap,ctSplineStyle] + else if AShapeClass = TPolylineShape then result := result + [ctShape,ctCloseShape,ctLineCap] + else if AShapeClass = TPhongShape then result := result + [ctPhong,ctAltitude] + else if AShapeClass = TTextShape then + begin + result := result + [ctText,ctAliasing]; + if TTextShape(AShape).PenPhong then include(result, ctAltitude); + end; +end; + procedure AlignShape(AShape: TVectorShape; ACommand: TToolCommand; const AMatrix: TAffineMatrix; const ARect: TRect); begin case ACommand of @@ -878,36 +909,16 @@ destructor TEditShapeTool.Destroy; function TEditShapeTool.GetContextualToolbars: TContextualToolbars; var shape: TVectorShape; - f: TVectorShapeFields; begin - Result:= [ctPenFill, ctBackFill]; case GetEditMode of esmShape: begin shape := GetVectorOriginal.SelectedShape; - - f := shape.MultiFields; - if vsfPenWidth in f then result += [ctPenWidth]; - if vsfPenStyle in f then result += [ctPenStyle]; - if vsfJoinStyle in f then result += [ctJoinStyle]; - if [vsfPenStyle,vsfPenFill,vsfBackFill] <= f then result += [ctShape]; - if vsfOutlineFill in f then - begin - result += [ctOutlineFill]; - if not (vsfBackFill in f) then result -= [ctBackFill]; - end; - if vsfOutlineWidth in f then result += [ctOutlineWidth]; - - if shape is TCurveShape then result := result + [ctShape,ctCloseShape,ctLineCap,ctSplineStyle] - else if shape is TPolylineShape then result := result + [ctShape,ctCloseShape,ctLineCap] - else if shape is TPhongShape then result := result + [ctPhong,ctAltitude] - else if shape is TTextShape then - begin - result := result + [ctText,ctAliasing]; - if TTextShape(shape).PenPhong then include(result, ctAltitude); - end; + result := ContextualToolbarsFromShape(TVectorShapeAny(shape.ClassType), shape); end; esmGradient: result := [ctBackFill]; + else + Result:= [ctPenFill, ctBackFill]; end; end; @@ -1856,6 +1867,11 @@ function TVectorialTool.AlwaysRasterizeShape: boolean; result := false; end; +function TVectorialTool.CreateShape: TVectorShape; +begin + result := ShapeClass.Create(nil); +end; + function TVectorialTool.UseOriginal: boolean; begin result := FUseOriginal; @@ -2291,6 +2307,11 @@ function TVectorialTool.SuggestGradientBox: TAffineBox; result:= inherited SuggestGradientBox; end; +function TVectorialTool.GetContextualToolbars: TContextualToolbars; +begin + result := ContextualToolbarsFromShape(ShapeClass, FShape); +end; + function TVectorialTool.Render(VirtualScreen: TBGRABitmap; VirtualScreenWidth, VirtualScreenHeight: integer; BitmapToVirtualScreen: TBitmapToVirtualScreenFunction): TRect; From f1baf31e8dca3d6f5157ee61b448ca5c5ca12cb1 Mon Sep 17 00:00:00 2001 From: johann Date: Fri, 27 Mar 2020 10:32:03 +0100 Subject: [PATCH 44/53] CTRL to select multiple shapes to avoid conflict with SHIFT --- lazpaint/tools/utoolvectorial.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lazpaint/tools/utoolvectorial.pas b/lazpaint/tools/utoolvectorial.pas index 42c0c6ae..4598b85c 100644 --- a/lazpaint/tools/utoolvectorial.pas +++ b/lazpaint/tools/utoolvectorial.pas @@ -1340,7 +1340,7 @@ function TEditShapeTool.ToolUp: TRect; zoom := (VectLen(m[1,1],m[2,1])+VectLen(m[1,2],m[2,2]))/2/Manager.Image.ZoomFactor; BindOriginalEvent(true); try - if GetVectorOriginal.MouseClick(m*FLastPos, DoScaleX(PointSize, OriginalDPI)*zoom, ssShift in ShiftState) then + if GetVectorOriginal.MouseClick(m*FLastPos, DoScaleX(PointSize, OriginalDPI)*zoom, ssCtrl in ShiftState) then begin handled := true; result := OnlyRenderChange; From 168db7e42117657b55f4541c91e817602e029539 Mon Sep 17 00:00:00 2001 From: johann Date: Fri, 27 Mar 2020 10:41:28 +0100 Subject: [PATCH 45/53] fix gradient edit for outline and multiselection --- lazpaint/tools/utoolvectorial.pas | 15 +++++++++++---- lazpaintcontrols/lcvectororiginal.pas | 12 ++++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/lazpaint/tools/utoolvectorial.pas b/lazpaint/tools/utoolvectorial.pas index 4598b85c..a314be95 100644 --- a/lazpaint/tools/utoolvectorial.pas +++ b/lazpaint/tools/utoolvectorial.pas @@ -1454,6 +1454,9 @@ function TEditShapeTool.ToolCommand(ACommand: TToolCommand): boolean; tcBackEditGradTexPoints: if GetVectorOriginal.SelectedShape.Usermode = BackGradTexMode then GetVectorOriginal.SelectedShape.Usermode := vsuEdit else GetVectorOriginal.SelectedShape.Usermode := BackGradTexMode; + tcOutlineEditGradTexPoints: if GetVectorOriginal.SelectedShape.Usermode = OutlineGradTexMode then + GetVectorOriginal.SelectedShape.Usermode := vsuEdit else + GetVectorOriginal.SelectedShape.Usermode := OutlineGradTexMode; tcForeAdjustToShape: GetVectorOriginal.SelectedShape.PenFill.FitGeometry(SuggestGradientBox); tcBackAdjustToShape: GetVectorOriginal.SelectedShape.BackFill.FitGeometry(SuggestGradientBox); tcOutlineAdjustToShape: GetVectorOriginal.SelectedShape.OutlineFill.FitGeometry(SuggestGradientBox); @@ -1547,9 +1550,11 @@ function TEditShapeTool.ToolProvideCommand(ACommand: TToolCommand): boolean; tcForeAdjustToShape,tcOutlineAdjustToShape: result := GetEditMode = esmShape; tcBackAdjustToShape: result := GetEditMode in [esmShape,esmGradient]; tcForeEditGradTexPoints: result := (GetEditMode = esmShape) and - (ForeGradTexMode in GetVectorOriginal.SelectedShape.Usermodes); + (ForeGradTexMode in GetVectorOriginal.SelectedShape.MultiUsermodes); tcBackEditGradTexPoints: result := (GetEditMode = esmShape) and - (BackGradTexMode in GetVectorOriginal.SelectedShape.Usermodes); + (BackGradTexMode in GetVectorOriginal.SelectedShape.MultiUsermodes); + tcOutlineEditGradTexPoints: result := (GetEditMode = esmShape) and + (OutlineGradTexMode in GetVectorOriginal.SelectedShape.MultiUsermodes); tcShapeToSpline: result:= (GetEditMode = esmShape) and TCurveShape.CanCreateFrom(GetVectorOriginal.SelectedShape); tcAlignLeft..tcAlignBottom: result:= GetEditMode in [esmShape, esmOtherOriginal, esmSelection]; @@ -2287,9 +2292,11 @@ function TVectorialTool.ToolProvideCommand(ACommand: TToolCommand): boolean; tcForeAdjustToShape, tcBackAdjustToShape, tcOutlineAdjustToShape: result := not IsSelectingTool and Assigned(FShape) and not FQuickDefine; tcForeEditGradTexPoints: result := not IsSelectingTool and Assigned(FShape) and not FQuickDefine and - (vsuEditPenFill in FShape.Usermodes) and not (FShape.Usermode = vsuCreate); + (ForeGradTexMode in FShape.Usermodes) and not (FShape.Usermode = vsuCreate); tcBackEditGradTexPoints: result := not IsSelectingTool and Assigned(FShape) and not FQuickDefine and - (vsuEditPenFill in FShape.Usermodes) and not (FShape.Usermode = vsuCreate); + (BackGradTexMode in FShape.Usermodes) and not (FShape.Usermode = vsuCreate); + tcOutlineEditGradTexPoints: result := not IsSelectingTool and Assigned(FShape) and not FQuickDefine and + (OutlineGradTexMode in FShape.Usermodes) and not (FShape.Usermode = vsuCreate); tcShapeToSpline: result:= not IsSelectingTool and not FQuickDefine and Assigned(FShape) and TCurveShape.CanCreateFrom(FShape); tcAlignLeft..tcAlignBottom: Result:= not FQuickDefine and Assigned(FShape); diff --git a/lazpaintcontrols/lcvectororiginal.pas b/lazpaintcontrols/lcvectororiginal.pas index d4271293..02c900f0 100644 --- a/lazpaintcontrols/lcvectororiginal.pas +++ b/lazpaintcontrols/lcvectororiginal.pas @@ -285,6 +285,7 @@ TVectorShape = class function MultiFields: TVectorShapeFields; virtual; class function Fields: TVectorShapeFields; virtual; class function Usermodes: TVectorShapeUsermodes; virtual; + function MultiUsermodes: TVectorShapeUsermodes; virtual; class function PreferPixelCentered: boolean; virtual; class function CreateEmpty: boolean; virtual; //create shape even if empty? property OnChange: TShapeChangeEvent read FOnChange write FOnChange; @@ -1590,6 +1591,17 @@ class function TVectorShape.Usermodes: TVectorShapeUsermodes; if vsfOutlineFill in Fields then result += [vsuEditOutlineFill]; end; +function TVectorShape.MultiUsermodes: TVectorShapeUsermodes; +var + f: TVectorShapeFields; +begin + result := [vsuEdit]; + f := MultiFields; + if vsfBackFill in f then result += [vsuEditBackFill]; + if vsfPenFill in f then result += [vsuEditPenFill]; + if vsfOutlineFill in f then result += [vsuEditOutlineFill]; +end; + class function TVectorShape.PreferPixelCentered: boolean; begin result := true; From bc2af3e046ca26ee897bc0c46bf41b0f1a9a1c23 Mon Sep 17 00:00:00 2001 From: johann Date: Fri, 27 Mar 2020 10:59:09 +0100 Subject: [PATCH 46/53] fix Escape/Return in text tool --- lazpaint/tools/utooltext.pas | 49 +++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/lazpaint/tools/utooltext.pas b/lazpaint/tools/utooltext.pas index 64b74ed1..4fec5e1a 100644 --- a/lazpaint/tools/utooltext.pas +++ b/lazpaint/tools/utooltext.pas @@ -206,38 +206,59 @@ function TToolText.DoToolKeyDown(var key: Word): TRect; end else if (Key = VK_ESCAPE) and Assigned(FShape) then begin - result := ValidateShape; + if FShape.Usermode = vsuEditText then + FShape.Usermode := vsuEdit + else + result := ValidateShape; Key := 0; end else if (Key = VK_RETURN) and Assigned(FShape) then begin handled := false; FShape.KeyDown(ShiftState, skReturn, handled); - if handled then Key := 0; + if not handled then ValidateShape; + Key := 0; end else Result:=inherited DoToolKeyDown(key); end; function TToolText.ToolCommand(ACommand: TToolCommand): boolean; begin - case ACommand of - tcCopy: Result:= Assigned(FShape) and TTextShape(FShape).CopySelection; - tcCut: Result:= Assigned(FShape) and TTextShape(FShape).CutSelection; - tcPaste: Result:= Assigned(FShape) and TTextShape(FShape).PasteSelection; - tcDelete: Result:= Assigned(FShape) and TTextShape(FShape).DeleteSelection; + if Assigned(FShape) and (FShape.Usermode = vsuEditText) then + case ACommand of + tcCopy: Result:= TTextShape(FShape).CopySelection; + tcCut: Result:= TTextShape(FShape).CutSelection; + tcPaste: Result:= TTextShape(FShape).PasteSelection; + tcDelete: Result:= TTextShape(FShape).DeleteSelection; + else + result := inherited ToolCommand(ACommand); + end else - result := inherited ToolCommand(ACommand); - end; + case ACommand of + tcDelete: + if Assigned(FShape) then + begin + CancelShape; + result := true; + end else result := false; + else result := inherited ToolCommand(ACommand); + end; end; function TToolText.ToolProvideCommand(ACommand: TToolCommand): boolean; begin - case ACommand of - tcCopy,tcCut,tcDelete: result := Assigned(FShape) and TTextShape(FShape).HasSelection; - tcPaste: result := Assigned(FShape); + if Assigned(FShape) and (FShape.Usermode = vsuEditText) then + case ACommand of + tcCopy,tcCut,tcDelete: result := TTextShape(FShape).HasSelection; + tcPaste: result := true; + else + result := inherited ToolProvideCommand(ACommand); + end else - result := inherited ToolProvideCommand(ACommand); - end; + case ACommand of + tcDelete: result := Assigned(FShape); + else result := inherited ToolProvideCommand(ACommand); + end; end; initialization From 1cc3197d9d8e278359b4fb499776abd0928555cf Mon Sep 17 00:00:00 2001 From: johann Date: Sat, 28 Mar 2020 10:55:58 +0100 Subject: [PATCH 47/53] multishape move up/down --- lazpaintcontrols/lcvectormultishape.pas | 81 ++++++++++++ lazpaintcontrols/lcvectororiginal.pas | 161 ++++++++++++++++++------ 2 files changed, 201 insertions(+), 41 deletions(-) diff --git a/lazpaintcontrols/lcvectormultishape.pas b/lazpaintcontrols/lcvectormultishape.pas index 71190d63..ee56d404 100644 --- a/lazpaintcontrols/lcvectormultishape.pas +++ b/lazpaintcontrols/lcvectormultishape.pas @@ -66,12 +66,17 @@ TVectorMultiselection = class(TCustomRectShape, IVectorMultishape) function GetBackVisible: boolean; override; function GetOutlineVisible: boolean; override; procedure NotifySelectionChanged; + procedure InternalMoveToIndex(AFirst: integer); public constructor Create(AContainer: TVectorOriginal); override; class function StorageClassName: RawByteString; override; destructor Destroy; override; procedure BeginUpdate(ADiffHandler: TVectorShapeDiffAny=nil); override; procedure EndUpdate; override; + procedure BringToFront; override; + procedure SendToBack; override; + procedure MoveUp(APassNonIntersectingShapes: boolean); override; + procedure MoveDown(APassNonIntersectingShapes: boolean); override; procedure ClearShapes; procedure AddShape(AShape: TVectorShape); procedure RemoveShape(AShape: TVectorShape); @@ -588,6 +593,21 @@ procedure TVectorMultiselection.NotifySelectionChanged; OnSelectionChange(self); end; +procedure TVectorMultiselection.InternalMoveToIndex(AFirst: integer); +var fromIndex, toIndex: array of integer; + i: Integer; +begin + if Container = nil then exit; + setlength(fromIndex, ShapeCount); + setlength(toIndex, ShapeCount); + for i := 0 to ShapeCount-1 do + begin + fromIndex[i] := Container.IndexOfShape(FShapes[i]); + toIndex[i] := AFirst + i; + end; + Container.MoveShapeToIndex(fromIndex, toIndex); +end; + function TVectorMultiselection.GetCornerPositition: single; begin result := 1; @@ -927,6 +947,67 @@ procedure TVectorMultiselection.EndUpdate; inherited EndUpdate; end; +procedure TVectorMultiselection.BringToFront; +begin + if Assigned(Container) then + InternalMoveToIndex(Container.ShapeCount - ShapeCount); +end; + +procedure TVectorMultiselection.SendToBack; +begin + InternalMoveToIndex(0); +end; + +procedure TVectorMultiselection.MoveUp(APassNonIntersectingShapes: boolean); +var + topIndex, i: Integer; + curBounds: TRectF; + touch: Boolean; +begin + if Container = nil then exit; + topIndex := Container.IndexOfShape(FrontShape); + while topIndex < Container.ShapeCount-1 do + begin + inc(topIndex); + curBounds := Container.Shape[topIndex].GetAlignBounds(InfiniteRect, AffineMatrixIdentity); + if not APassNonIntersectingShapes then break; + touch := false; + for i := 0 to ShapeCount-1 do + if FShapes[i].GetAlignBounds(InfiniteRect, AffineMatrixIdentity).IntersectsWith(curBounds) then + begin + touch := true; + break; + end; + if touch then break; + end; + InternalMoveToIndex(topIndex + 1 - ShapeCount); +end; + +procedure TVectorMultiselection.MoveDown(APassNonIntersectingShapes: boolean); +var + bottomIndex, i: Integer; + curBounds: TRectF; + touch: Boolean; +begin + if Container = nil then exit; + bottomIndex := Container.IndexOfShape(FrontShape); + while bottomIndex > 0 do + begin + dec(bottomIndex); + curBounds := Container.Shape[bottomIndex].GetAlignBounds(InfiniteRect, AffineMatrixIdentity); + if not APassNonIntersectingShapes then break; + touch := false; + for i := 0 to ShapeCount-1 do + if FShapes[i].GetAlignBounds(InfiniteRect, AffineMatrixIdentity).IntersectsWith(curBounds) then + begin + touch := true; + break; + end; + if touch then break; + end; + InternalMoveToIndex(bottomIndex); +end; + initialization VectorMultiselectionFactory := TVectorMultiselection; diff --git a/lazpaintcontrols/lcvectororiginal.pas b/lazpaintcontrols/lcvectororiginal.pas index 02c900f0..f3fbb369 100644 --- a/lazpaintcontrols/lcvectororiginal.pas +++ b/lazpaintcontrols/lcvectororiginal.pas @@ -1,6 +1,7 @@ unit LCVectorOriginal; {$mode objfpc}{$H+} +{$modeswitch advancedrecords} interface @@ -263,10 +264,10 @@ TVectorShape = class procedure KeyDown({%H-}Shift: TShiftState; {%H-}Key: TSpecialKey; var {%H-}AHandled: boolean); virtual; procedure KeyUp({%H-}Shift: TShiftState; {%H-}Key: TSpecialKey; var {%H-}AHandled: boolean); virtual; procedure KeyPress({%H-}UTF8Key: string; var {%H-}AHandled: boolean); virtual; - procedure BringToFront; - procedure SendToBack; - procedure MoveUp(APassNonIntersectingShapes: boolean); - procedure MoveDown(APassNonIntersectingShapes: boolean); + procedure BringToFront; virtual; + procedure SendToBack; virtual; + procedure MoveUp(APassNonIntersectingShapes: boolean); virtual; + procedure MoveDown(APassNonIntersectingShapes: boolean); virtual; procedure Remove; procedure AlignHorizontally(AAlign: TAlignment; const AMatrix: TAffineMatrix; const ABounds: TRect); virtual; procedure AlignVertically(AAlign: TTextLayout; const AMatrix: TAffineMatrix; const ABounds: TRect); virtual; @@ -354,9 +355,11 @@ TVectorOriginalShapeRangeDiff = class(TBGRAOriginalDiff) TVectorOriginalMoveShapeToIndexDiff = class(TBGRAOriginalDiff) protected - FFromIndex,FToIndex: integer; + FFromIndex,FToIndex: array of integer; + FShapeCount: integer; + procedure InternalMove(AOriginal: TBGRALayerCustomOriginal; AFromIndex,AToIndex: array of integer; ASendDiff: boolean); public - constructor Create(AFromIndex,AToIndex: integer); + constructor Create(AFromIndex,AToIndex: array of integer); procedure Apply(AOriginal: TBGRALayerCustomOriginal); overload; override; procedure Apply(AOriginal: TBGRALayerCustomOriginal; ASendDiff: boolean); overload; procedure Unapply(AOriginal: TBGRALayerCustomOriginal); override; @@ -445,7 +448,8 @@ TVectorOriginal = class(TBGRALayerCustomOriginal) procedure SaveToStorage(AStorage: TBGRACustomOriginalStorage); override; function IndexOfShape(AShape: TVectorShape): integer; function FindShapeById(AId: integer): TVectorShape; - procedure MoveShapeToIndex(AFromIndex: integer; AToIndex: integer); + procedure MoveShapeToIndex(AFromIndex, AToIndex: integer); overload; + procedure MoveShapeToIndex(AFromIndex, AToIndex: array of integer); overload; class function StorageClassName: RawByteString; override; property OnSelectShape: TVectorOriginalSelectShapeEvent read FOnSelectShape write FOnSelectShape; property SelectedShape: TVectorShape read FSelectedShape; @@ -527,11 +531,77 @@ procedure RegisterVectorShape(AClass: TVectorShapeAny); { TVectorOriginalMoveShapeToIndexDiff } +type + TMovedShape = record + shape: TVectorShape; + targetIndex: integer; + class operator =(const ms1, ms2: TMovedShape): boolean; + end; + +class operator TMovedShape.=(const ms1, ms2: TMovedShape): boolean; +begin + result := (ms1.shape = ms2.shape) and (ms1.targetIndex = ms2.targetIndex); +end; + +function CompareMovedShapeTargetIndex(const ms1, ms2: TMovedShape): integer; +begin + result := ms1.targetIndex - ms2.targetIndex; +end; + +procedure TVectorOriginalMoveShapeToIndexDiff.InternalMove(AOriginal: TBGRALayerCustomOriginal; AFromIndex, + AToIndex: array of integer; ASendDiff: boolean); +type + TMovedShapeList = specialize TFPGList; +var + movedShapes: TMovedShapeList; + ms: TMovedShape; + r: TRectF; + i: Integer; + orig: TVectorOriginal; +begin + if FShapeCount = 0 then exit; + orig := AOriginal as TVectorOriginal; + movedShapes := TMovedShapeList.Create; + for i := 0 to FShapeCount-1 do + begin + ms.shape := orig.Shape[AFromIndex[i]]; + ms.targetIndex:= AToIndex[i]; + movedShapes.Add(ms); + end; + movedShapes.Sort(@CompareMovedShapeTargetIndex); + if movedShapes[0].targetIndex > orig.IndexOfShape(movedShapes[0].shape) then + begin + for i := movedShapes.Count-1 downto 0 do + orig.FShapes.Move(orig.IndexOfShape(movedShapes[i].shape), movedShapes[i].targetIndex); + end else + for i := 0 to movedShapes.Count-1 do + orig.FShapes.Move(orig.IndexOfShape(movedShapes[i].shape), movedShapes[i].targetIndex); + + orig.DiscardFrozenShapes; + r := EmptyRectF; + for i := 0 to movedShapes.Count-1 do + r := r.Union(movedShapes[i].shape.GetRenderBounds(InfiniteRect, AffineMatrixIdentity), true); + movedShapes.Free; + + if ASendDiff then orig.NotifyChange(r,self) + else orig.NotifyChange(r); +end; + constructor TVectorOriginalMoveShapeToIndexDiff.Create(AFromIndex, - AToIndex: integer); + AToIndex: array of integer); +var + i: Integer; begin - FFromIndex:= AFromIndex; - FToIndex := AToIndex; + if length(AFromIndex) <> length(AToIndex) then + raise exception.Create('Dimension mismatch'); + FShapeCount:= length(AFromIndex); + setlength(FFromIndex, FShapeCount); + setlength(FToIndex, FShapeCount); + for i := 0 to FShapeCount-1 do + begin + FFromIndex[i] := AFromIndex[i]; + FToIndex[i] := AToIndex[i]; + end; end; procedure TVectorOriginalMoveShapeToIndexDiff.Apply( @@ -542,50 +612,53 @@ procedure TVectorOriginalMoveShapeToIndexDiff.Apply( procedure TVectorOriginalMoveShapeToIndexDiff.Apply( AOriginal: TBGRALayerCustomOriginal; ASendDiff: boolean); -var - movedShape: TVectorShape; - r: TRectF; begin - with (AOriginal as TVectorOriginal) do - begin - movedShape := FShapes[FFromIndex]; - FShapes.Move(FFromIndex,FToIndex); - DiscardFrozenShapes; - r := movedShape.GetRenderBounds(InfiniteRect, AffineMatrixIdentity); - if ASendDiff then NotifyChange(r,self) - else NotifyChange(r); - end; + InternalMove(AOriginal, FFromIndex, FToIndex, ASendDiff); end; procedure TVectorOriginalMoveShapeToIndexDiff.Unapply( AOriginal: TBGRALayerCustomOriginal); -var - movedShape: TVectorShape; begin - with (AOriginal as TVectorOriginal) do - begin - movedShape := FShapes[FToIndex]; - FShapes.Move(FToIndex,FFromIndex); - DiscardFrozenShapes; - NotifyChange(movedShape.GetRenderBounds(InfiniteRect, AffineMatrixIdentity)); - end; + InternalMove(AOriginal, FToIndex, FFromIndex, False); end; function TVectorOriginalMoveShapeToIndexDiff.CanAppend(ADiff: TBGRAOriginalDiff): boolean; +var + other: TVectorOriginalMoveShapeToIndexDiff; + i: Integer; begin - result := (ADiff is TVectorOriginalMoveShapeToIndexDiff) and - (TVectorOriginalMoveShapeToIndexDiff(ADiff).FFromIndex = FToIndex); + if ADiff is TVectorOriginalMoveShapeToIndexDiff then + begin + other := TVectorOriginalMoveShapeToIndexDiff(ADiff); + if other.FShapeCount <> FShapeCount then exit(false); + for i := 0 to FShapeCount-1 do + if other.FFromIndex[i] <> FToIndex[i] then exit(false); + result := true; + end else + result := false; end; procedure TVectorOriginalMoveShapeToIndexDiff.Append(ADiff: TBGRAOriginalDiff); +var + other: TVectorOriginalMoveShapeToIndexDiff; + i: Integer; begin if CanAppend(ADiff) then - FToIndex:= (ADiff as TVectorOriginalMoveShapeToIndexDiff).FToIndex; + begin + other := ADiff as TVectorOriginalMoveShapeToIndexDiff; + for i := 0 to FShapeCount-1 do + FToIndex[i] := other.FToIndex[i]; + end; end; function TVectorOriginalMoveShapeToIndexDiff.IsIdentity: boolean; +var + i: Integer; begin - result := (FFromIndex = FToIndex); + for i := 0 to FShapeCount-1 do + if FFromIndex[i] <> FToIndex[i] then + exit(false); + result := true; end; { TVectorShapeDiff } @@ -2300,10 +2373,10 @@ procedure TVectorShape.MoveUp(APassNonIntersectingShapes: boolean); idx := sourceIdx; if APassNonIntersectingShapes then begin - movedShapeBounds := self.GetRenderBounds(InfiniteRect, AffineMatrixIdentity); + movedShapeBounds := self.GetAlignBounds(InfiniteRect, AffineMatrixIdentity); while idx < Container.ShapeCount-2 do begin - otherShapeBounds := Container.Shape[idx+1].GetRenderBounds(InfiniteRect, AffineMatrixIdentity); + otherShapeBounds := Container.Shape[idx+1].GetAlignBounds(InfiniteRect, AffineMatrixIdentity); if movedShapeBounds.IntersectsWith(otherShapeBounds) then break; inc(idx); end; @@ -2323,10 +2396,10 @@ procedure TVectorShape.MoveDown(APassNonIntersectingShapes: boolean); idx := sourceIdx; if APassNonIntersectingShapes then begin - movedShapeBounds := self.GetRenderBounds(InfiniteRect, AffineMatrixIdentity); + movedShapeBounds := self.GetAlignBounds(InfiniteRect, AffineMatrixIdentity); while idx > 1 do begin - otherShapeBounds := Container.Shape[idx-1].GetRenderBounds(InfiniteRect, AffineMatrixIdentity); + otherShapeBounds := Container.Shape[idx-1].GetAlignBounds(InfiniteRect, AffineMatrixIdentity); if movedShapeBounds.IntersectsWith(otherShapeBounds) then break; dec(idx); end; @@ -3454,11 +3527,17 @@ function TVectorOriginal.IndexOfShape(AShape: TVectorShape): integer; result := FShapes.IndexOf(AShape); end; -procedure TVectorOriginal.MoveShapeToIndex(AFromIndex: integer; AToIndex: integer); +procedure TVectorOriginal.MoveShapeToIndex(AFromIndex, AToIndex: integer); +begin + MoveShapeToIndex([AFromIndex], [AToIndex]); +end; + +procedure TVectorOriginal.MoveShapeToIndex(AFromIndex, + AToIndex: array of integer); var diff: TVectorOriginalMoveShapeToIndexDiff; begin - diff := TVectorOriginalMoveShapeToIndexDiff.Create(AFromIndex,AToIndex); + diff := TVectorOriginalMoveShapeToIndexDiff.Create(AFromIndex, AToIndex); if diff.IsIdentity then begin diff.Free; From 71f8db0b36c29b8d69e9c2f90ec53ab326338c9e Mon Sep 17 00:00:00 2001 From: johann Date: Mon, 30 Mar 2020 12:09:53 +0200 Subject: [PATCH 48/53] fix tool editor update --- lazpaint/image/uimage.pas | 10 +++++++--- lazpaint/lazpaintinstance.pas | 1 - lazpaint/lazpaintmainform.pas | 7 +++++++ lazpaint/tools/utool.pas | 20 +++++++++++++------- lazpaint/tools/utoolvectorial.pas | 3 --- lazpaint/uimageview.pas | 21 +++++++++++++++------ lazpaintcontrols/lcvectormultishape.pas | 4 +++- lazpaintcontrols/lcvectororiginal.pas | 2 +- 8 files changed, 46 insertions(+), 22 deletions(-) diff --git a/lazpaint/image/uimage.pas b/lazpaint/image/uimage.pas index f6ef1e5c..7e6f5791 100644 --- a/lazpaint/image/uimage.pas +++ b/lazpaint/image/uimage.pas @@ -48,6 +48,7 @@ TLazPaintImage = class FRenderedImage: TBGRABitmap; FRenderedImageInvalidated: TRect; FOnImageChanged, FOnImageSaving, FOnImageExport: TLazPaintImageObservable; + FOnImageRenderChanged: TNotifyEvent; FUndoList: TComposedImageDifference; FUndoPos: integer; FRenderUpdateRectInPicCoord, FRenderUpdateRectInVSCoord: TRect; @@ -160,7 +161,7 @@ TLazPaintImage = class procedure LayerMayChangeCompletely(ALayer: TBGRABitmap); procedure SelectionMaskMayChange(ARect: TRect); procedure SelectionMaskMayChangeCompletely; - procedure RenderMayChange(ARect: TRect; APicCoords: boolean = false); + procedure RenderMayChange(ARect: TRect; APicCoords: boolean = false; ANotify: boolean = true); procedure ResetRenderUpdateRect; // selection mask @@ -257,6 +258,7 @@ TLazPaintImage = class property OnSelectedLayerIndexChanged: TOnCurrentLayerIndexChanged read FOnSelectedLayerIndexChanged write FOnSelectedLayerIndexChanged; property OnStackChanged: TOnStackChanged read FOnStackChanged write FOnStackChanged; property OnImageChanged: TLazPaintImageObservable read FOnImageChanged; + property OnImageRenderChanged: TNotifyEvent read FOnImageRenderChanged write FOnImageRenderChanged; property OnImageSaving: TLazPaintImageObservable read FOnImageSaving; property OnImageExport: TLazPaintImageObservable read FOnImageExport; property OnActionProgress: TLayeredActionProgressEvent read FOnActionProgress write SetOnActionProgress; @@ -1281,12 +1283,14 @@ procedure TLazPaintImage.SelectionMaskMayChangeCompletely; OnImageChanged.NotifyObservers; end; -procedure TLazPaintImage.RenderMayChange(ARect: TRect; APicCoords: boolean = false); +procedure TLazPaintImage.RenderMayChange(ARect: TRect; APicCoords: boolean; ANotify: boolean); begin if APicCoords then FRenderUpdateRectInPicCoord := RectUnion(FRenderUpdateRectInPicCoord,ARect) else - FRenderUpdateRectInVSCoord := RectUnion(FRenderUpdateRectInVSCoord,ARect); + FRenderUpdateRectInVSCoord := RectUnion(FRenderUpdateRectInVSCoord,ARect); + if ANotify and Assigned(OnImageRenderChanged) then + OnImageRenderChanged(self); end; procedure TLazPaintImage.LayerBlendMayChange(AIndex: integer); diff --git a/lazpaint/lazpaintinstance.pas b/lazpaint/lazpaintinstance.pas index 748d1e78..5227a78e 100644 --- a/lazpaint/lazpaintinstance.pas +++ b/lazpaint/lazpaintinstance.pas @@ -1038,7 +1038,6 @@ procedure TLazPaintInstance.SetGridVisible(const AValue: boolean); begin FGridVisible := AValue; Image.RenderMayChange(rect(0,0,Image.Width,Image.Height),True); - NotifyImageChange(False,EmptyRect); end; function TLazPaintInstance.GetChooseColorVisible: boolean; diff --git a/lazpaint/lazpaintmainform.pas b/lazpaint/lazpaintmainform.pas index 25ef225a..44302dd8 100644 --- a/lazpaint/lazpaintmainform.pas +++ b/lazpaint/lazpaintmainform.pas @@ -811,6 +811,7 @@ TFMain = class(TForm) procedure HideFill(ATimeMs: Integer = 300; AClearTime: boolean = false); procedure OnPaintHandler; procedure OnImageChangedHandler({%H-}AEvent: TLazPaintImageObservationEvent); + procedure OnImageRenderChanged(sender: TObject); procedure LabelAutosize(ALabel: TLabel); procedure AskMergeSelection(ACaption: string); procedure ReleaseMouseButtons(Shift: TShiftState); @@ -1152,6 +1153,7 @@ procedure TFMain.Init; RegisterScripts(True); Image.OnImageChanged.AddObserver(@OnImageChangedHandler); + Image.OnImageRenderChanged := @OnImageRenderChanged; Image.OnQueryExitToolHandler := @OnQueryExitToolHandler; Image.Zoom := Zoom; UpdateWindowCaption; @@ -4398,6 +4400,11 @@ procedure TFMain.OnImageChangedHandler(AEvent: TLazPaintImageObservationEvent); if AEvent.DelayedStackUpdate then FUpdateStackWhenIdle := true; end; +procedure TFMain.OnImageRenderChanged(sender: TObject); +begin + InvalidatePicture; +end; + procedure TFMain.UpdateEditPicture(ADelayed: boolean = false); begin if ToolManager.ToolUpdate then diff --git a/lazpaint/tools/utool.pas b/lazpaint/tools/utool.pas index 3f2be77e..c434f72e 100644 --- a/lazpaint/tools/utool.pas +++ b/lazpaint/tools/utool.pas @@ -198,6 +198,7 @@ TToolManager = class FSleepingToolType: TPaintToolType; FReturnValidatesHintShown: boolean; FOnToolChangedHandler: TOnToolChangedHandler; + FOnToolRenderChanged: TNotifyEvent; FOnToolbarChanged: TNotifyEvent; FOnPopupToolHandler: TOnPopupToolHandler; @@ -491,7 +492,7 @@ TToolManager = class function IsOutlineEditGradTexPoints: boolean; procedure QueryExitTool; - procedure RenderTool(formBitmap: TBGRABitmap); + function RenderTool(formBitmap: TBGRABitmap): TRect; function GetRenderBounds(VirtualScreenWidth, VirtualScreenHeight: integer): TRect; function SuggestGradientBox: TAffineBox; @@ -569,6 +570,7 @@ TToolManager = class 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; @@ -3147,11 +3149,11 @@ procedure TToolManager.InternalSetCurrentToolType(tool: TPaintToolType); 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; @@ -3357,10 +3359,11 @@ procedure TToolManager.ToolWakeUp; 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; @@ -3685,6 +3688,8 @@ procedure TToolManager.ToolOpen; try FCurrentTool := PaintTools[FCurrentToolType].Create(self); UpdateContextualToolbars; + If Assigned(FOnToolRenderChanged) then + FOnToolRenderChanged(self); finally FInTool := false; end; @@ -3765,17 +3770,18 @@ procedure TToolManager.QueryExitTool; 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; diff --git a/lazpaint/tools/utoolvectorial.pas b/lazpaint/tools/utoolvectorial.pas index a314be95..8ab96767 100644 --- a/lazpaint/tools/utoolvectorial.pas +++ b/lazpaint/tools/utoolvectorial.pas @@ -1605,10 +1605,7 @@ procedure TVectorialTool.ShapeEditingChange(ASender: TObject); newEditorBounds := Editor.GetRenderBounds(rect(0,0,ceil(x),ceil(y))); r := RectUnion(FPreviousEditorBounds,newEditorBounds); if not r.IsEmpty then - begin Manager.Image.RenderMayChange(r,false); - Manager.Image.OnImageChanged.NotifyObservers; - end; FPreviousEditorBounds := newEditorBounds; end; diff --git a/lazpaint/uimageview.pas b/lazpaint/uimageview.pas index 2c5c350c..4b42a9a9 100644 --- a/lazpaint/uimageview.pas +++ b/lazpaint/uimageview.pas @@ -36,7 +36,7 @@ TImageView = class FZoom: TZoom; FPictureCanvas: TCanvas; function GetImage: TLazPaintImage; - function GetRenderUpdateRectVS(AIncludeLastToolState: boolean): TRect; + function GetRenderUpdateRectVS(AIncludeCurrentToolEditor: boolean): TRect; function GetFillSelectionHighlight: boolean; function GetPenCursorPosition: TVSCursorPosition; function GetWorkspaceColor: TColor; @@ -48,6 +48,7 @@ TImageView = class procedure SetFillSelectionHighlight(AValue: boolean); procedure SetShowSelection(AValue: boolean); procedure PictureSelectionChanged({%H-}sender: TLazPaintImage; const ARect: TRect); + procedure ToolManagerRenderChanged(Sender: TObject); procedure PaintVirtualScreenCursor({%H-}ACanvasOfs: TPoint; {%H-}AWorkArea: TRect; {%H-}AWinControlOfs: TPoint; {%H-}AWinControl: TWinControl); function GetRectToInvalidate(AInvalidateAll: boolean; AWorkArea: TRect): TRect; function GetPictureCoordsDefined: boolean; @@ -110,6 +111,13 @@ function TImageView.GetPictureCoordsDefined: boolean; result := FLastPictureParameters.defined; end; +procedure TImageView.ToolManagerRenderChanged(Sender: TObject); +begin + if Assigned(FVirtualScreen) then + Image.RenderMayChange(LazPaintInstance.ToolManager.GetRenderBounds( + FVirtualScreen.Width, FVirtualScreen.Height)); +end; + function TImageView.GetImage: TLazPaintImage; begin result := FInstance.Image; @@ -190,10 +198,10 @@ procedure TImageView.PaintPictureImplementation(ACanvasOfs: TPoint; AWorkArea: T DrawSelectionHighlight(renderRect); end; FVirtualScreen.NoClip; - end; - //show tools info - LazPaintInstance.ToolManager.RenderTool(FVirtualScreen); + //show tools info + Image.RenderMayChange(LazPaintInstance.ToolManager.RenderTool(FVirtualScreen), false, false); + end; PaintVirtualScreenImplementation(ACanvasOfs, AWorkArea, AVSPart); Image.VisibleArea := TRectF.Intersect(rectF(FormToBitmap(AWorkArea.Left, AWorkArea.Top), @@ -308,6 +316,7 @@ constructor TImageView.Create(AInstance: TLazPaintCustomInstance; AZoom: TZoom; FSelectionHighlight := TSelectionHighlight.Create(Image); FShowSelection:= true; Image.OnSelectionChanged := @PictureSelectionChanged; + LazPaintInstance.ToolManager.OnToolRenderChanged:=@ToolManagerRenderChanged; LazPaintInstance.ToolManager.BitmapToVirtualScreen := @BitmapToVirtualScreen; end; @@ -391,7 +400,7 @@ procedure TImageView.OnZoomChanged(sender: TZoom; ANewZoom: single; AWorkArea: T FLastPictureParameters.defined := false; end; -function TImageView.GetRenderUpdateRectVS(AIncludeLastToolState: boolean): TRect; +function TImageView.GetRenderUpdateRectVS(AIncludeCurrentToolEditor: boolean): TRect; const displayMargin = 1; begin result := Image.RenderUpdateRectInPicCoord; @@ -409,7 +418,7 @@ function TImageView.GetRenderUpdateRectVS(AIncludeLastToolState: boolean): TRect end; end; result := RectUnion(result, Image.RenderUpdateRectInVSCoord); - if AIncludeLastToolState and Assigned(FVirtualScreen) then + if AIncludeCurrentToolEditor and Assigned(FVirtualScreen) then result := RectUnion(result, LazPaintInstance.ToolManager.GetRenderBounds(FVirtualScreen.Width,FVirtualScreen.Height)); end; diff --git a/lazpaintcontrols/lcvectormultishape.pas b/lazpaintcontrols/lcvectormultishape.pas index ee56d404..1080e37b 100644 --- a/lazpaintcontrols/lcvectormultishape.pas +++ b/lazpaintcontrols/lcvectormultishape.pas @@ -321,8 +321,10 @@ procedure TVectorMultiselection.ContainedShape_Change(ASender: TObject; contained.AppendForShape(ASender as TVectorShape, ADiff); ADiff.Free; end else - if Assigned(OnChange) then + begin + if not IsUpdating and Assigned(OnChange) then OnChange(self, ABounds, nil); + end; end; procedure TVectorMultiselection.UpdateFromShapes; diff --git a/lazpaintcontrols/lcvectororiginal.pas b/lazpaintcontrols/lcvectororiginal.pas index f3fbb369..fa5ac71d 100644 --- a/lazpaintcontrols/lcvectororiginal.pas +++ b/lazpaintcontrols/lcvectororiginal.pas @@ -2956,7 +2956,7 @@ function TVectorOriginal.SelectShapes(AShapes: TVectorShapes): boolean; else begin FSelectedShape := FMultiselection; - if not FMultiselection.GetAsMultishape.SetShapes(AShapes) then + if FMultiselection.GetAsMultishape.SetShapes(AShapes) then NotifyEditorChange; end; end; From b7129a46a71861eb977250afdf818ba716d25d8b Mon Sep 17 00:00:00 2001 From: johann Date: Mon, 30 Mar 2020 12:20:29 +0200 Subject: [PATCH 49/53] fix blur radius textbox size --- lazpaint/dialog/filter/umotionblur.pas | 1 + lazpaint/dialog/filter/uradialblur.lfm | 47 +++++++++++++------------- lazpaint/dialog/filter/uradialblur.pas | 1 + 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/lazpaint/dialog/filter/umotionblur.pas b/lazpaint/dialog/filter/umotionblur.pas index 065c008c..33e4fb3b 100644 --- a/lazpaint/dialog/filter/umotionblur.pas +++ b/lazpaint/dialog/filter/umotionblur.pas @@ -218,6 +218,7 @@ procedure TFMotionBlur.FormCreate(Sender: TObject); InPaintBoxMouseMove := false; CheckOKCancelBtns(Button_OK{,Button_Cancel}); CheckFloatSpinEdit(SpinEdit_Distance); + SpinEdit_Distance.Constraints.MinWidth := DoScaleX(70, OriginalDPI); end; procedure TFMotionBlur.FormShow(Sender: TObject); diff --git a/lazpaint/dialog/filter/uradialblur.lfm b/lazpaint/dialog/filter/uradialblur.lfm index 1a5e6a10..3fc32cc6 100644 --- a/lazpaint/dialog/filter/uradialblur.lfm +++ b/lazpaint/dialog/filter/uradialblur.lfm @@ -1,6 +1,6 @@ object FRadialBlur: TFRadialBlur Left = 403 - Height = 70 + Height = 82 Top = 328 Width = 175 AutoSize = True @@ -13,43 +13,42 @@ object FRadialBlur: TFRadialBlur ChildSizing.VerticalSpacing = 8 ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 1 - ClientHeight = 70 + ClientHeight = 82 ClientWidth = 175 Font.Height = -12 OnCloseQuery = FormCloseQuery OnCreate = FormCreate OnShow = FormShow Position = poOwnerFormCenter - LCLVersion = '1.6.0.4' + LCLVersion = '2.0.2.0' object Panel1: TPanel Left = 8 - Height = 23 + Height = 27 Top = 8 - Width = 114 + Width = 126 BevelOuter = bvNone ChildSizing.HorizontalSpacing = 8 ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 2 - ClientHeight = 23 - ClientWidth = 114 + ClientHeight = 27 + ClientWidth = 126 TabOrder = 0 object Label_Radius: TLabel Left = 0 - Height = 23 + Height = 27 Top = 0 - Width = 41 + Width = 48 Caption = 'Radius :' Layout = tlCenter ParentColor = False end object SpinEdit_Radius: TFloatSpinEdit - Left = 49 - Height = 23 + Left = 56 + Height = 27 Top = 0 - Width = 65 - Constraints.MinWidth = 65 + Width = 70 + Constraints.MinWidth = 70 DecimalPlaces = 1 - Increment = 1 MaxValue = 1000 MinValue = 0.1 OnChange = SpinEdit_RadiusChange @@ -59,21 +58,21 @@ object FRadialBlur: TFRadialBlur end object Panel2: TPanel Left = 8 - Height = 25 - Top = 39 - Width = 114 + Height = 29 + Top = 43 + Width = 126 BevelOuter = bvNone ChildSizing.HorizontalSpacing = 8 ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 2 - ClientHeight = 25 - ClientWidth = 114 + ClientHeight = 29 + ClientWidth = 126 TabOrder = 1 object Button_OK: TButton Left = 0 - Height = 25 + Height = 29 Top = 0 - Width = 42 + Width = 31 AutoSize = True Caption = 'OK' Default = True @@ -81,10 +80,10 @@ object FRadialBlur: TFRadialBlur TabOrder = 0 end object Button_Cancel: TButton - Left = 50 - Height = 25 + Left = 39 + Height = 29 Top = 0 - Width = 62 + Width = 54 AutoSize = True Cancel = True Caption = 'Cancel' diff --git a/lazpaint/dialog/filter/uradialblur.pas b/lazpaint/dialog/filter/uradialblur.pas index 52bdd155..c56845e0 100644 --- a/lazpaint/dialog/filter/uradialblur.pas +++ b/lazpaint/dialog/filter/uradialblur.pas @@ -95,6 +95,7 @@ procedure TFRadialBlur.FormCreate(Sender: TObject); blurType := rbNormal; CheckOKCancelBtns(Button_OK{,Button_Cancel}); CheckFloatSpinEdit(SpinEdit_Radius); + SpinEdit_Radius.Constraints.MinWidth := DoScaleX(70, OriginalDPI); end; procedure TFRadialBlur.FormShow(Sender: TObject); From c38b7c59b23c9d8fcfbb63e34a2d50ac30ec1da7 Mon Sep 17 00:00:00 2001 From: johann Date: Fri, 3 Apr 2020 10:01:32 +0200 Subject: [PATCH 50/53] Liberation Sans as default font --- lazpaint/tools/utool.pas | 5 +++-- lazpaint/uconfig.pas | 2 +- lazpaintcontrols/lcvectortextshapes.pas | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lazpaint/tools/utool.pas b/lazpaint/tools/utool.pas index c434f72e..5b2775fc 100644 --- a/lazpaint/tools/utool.pas +++ b/lazpaint/tools/utool.pas @@ -603,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; @@ -2884,7 +2884,7 @@ constructor TToolManager.Create(AImage: TLazPaintImage; AConfigProvider: IConfig FTextOutlineWidth := 2; FTextShadow := false; FTextFontSize := 10; - FTextFontName := 'Arial'; + FTextFontName := TTextShape.DefaultFontName; FTextFontStyle:= []; FTextAlign := taLeftJustify; FTextPhong := False; @@ -3478,6 +3478,7 @@ procedure TToolManager.RemoveBrushAt(index: integer); 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 diff --git a/lazpaint/uconfig.pas b/lazpaint/uconfig.pas index aa57d541..a5875a1f 100644 --- a/lazpaint/uconfig.pas +++ b/lazpaint/uconfig.pas @@ -946,7 +946,7 @@ procedure TLazPaintConfig.SetDefaultToolTextShadow(value: boolean); function TLazPaintConfig.DefaultToolTextFont: TFont; var fontStyle: TFontStyles; begin - tempFont.Name := iniOptions.ReadString('Tool','TextFontName','Arial'); + tempFont.Name := iniOptions.ReadString('Tool','TextFontName',''); tempFont.Size := iniOptions.ReadInteger('Tool','TextFontSize',10); fontStyle := []; if iniOptions.ReadBool('Tool','TextFontBold',False) then fontStyle += [fsBold]; diff --git a/lazpaintcontrols/lcvectortextshapes.pas b/lazpaintcontrols/lcvectortextshapes.pas index aa62cdc7..94a678ce 100644 --- a/lazpaintcontrols/lcvectortextshapes.pas +++ b/lazpaintcontrols/lcvectortextshapes.pas @@ -1127,7 +1127,7 @@ class function TTextShape.PreferPixelCentered: boolean; class function TTextShape.DefaultFontName: string; begin - result := {$IFDEF WINDOWS}'Arial'{$ELSE}{$IFDEF DARWIN}'Helvetica'{$ELSE}'FreeSans'{$ENDIF}{$ENDIF}; + result := {$IFDEF WINDOWS}'Arial'{$ELSE}{$IFDEF DARWIN}'Helvetica'{$ELSE}'Liberation Sans'{$ENDIF}{$ENDIF}; end; class function TTextShape.DefaultFontEmHeight: single; From f6ea6a51d5d000c51ab8c361adbc1b29c33c8b7e Mon Sep 17 00:00:00 2001 From: johann Date: Fri, 3 Apr 2020 10:30:54 +0200 Subject: [PATCH 51/53] fix key modifiers handling preserve complex typing, update perspective transform editor --- lazpaint/tools/utool.pas | 38 +++++++------------------ lazpaint/tools/utooldeformationgrid.pas | 12 +++++++- 2 files changed, 21 insertions(+), 29 deletions(-) diff --git a/lazpaint/tools/utool.pas b/lazpaint/tools/utool.pas index 5b2775fc..dfe57fe5 100644 --- a/lazpaint/tools/utool.pas +++ b/lazpaint/tools/utool.pas @@ -1115,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; diff --git a/lazpaint/tools/utooldeformationgrid.pas b/lazpaint/tools/utooldeformationgrid.pas index 0578d47d..5b75dbd6 100644 --- a/lazpaint/tools/utooldeformationgrid.pas +++ b/lazpaint/tools/utooldeformationgrid.pas @@ -74,6 +74,7 @@ TToolTextureMapping = class(TGenericTool) function DoToolMove({%H-}toolDest: TBGRABitmap; {%H-}pt: TPoint; ptF: TPointF): TRect; override; function DoToolKeyDown(var key: Word): TRect; override; + function DoToolKeyUp(var key: Word): TRect; override; function GetIsSelectingTool: boolean; override; function GetTexture: TBGRABitmap; virtual; function GetTextureRepetition: TTextureRepetition; virtual; @@ -727,7 +728,16 @@ function TToolTextureMapping.DoToolKeyDown(var key: Word): TRect; manager.QueryExitTool; key := 0; end; - end; + end else + if (Key = VK_SHIFT) or (Key = VK_MENU) then + UpdateBoundsMode(result); +end; + +function TToolTextureMapping.DoToolKeyUp(var key: Word): TRect; +begin + Result:= EmptyRect; + if (Key = VK_SHIFT) or (Key = VK_MENU) then + UpdateBoundsMode(result); end; function TToolTextureMapping.ToolUp: TRect; From c0e553ce1209b219e4fc0c57bd3541652a7cda14 Mon Sep 17 00:00:00 2001 From: johann Date: Fri, 3 Apr 2020 10:57:11 +0200 Subject: [PATCH 52/53] latest BGRABitmap dependency --- lazpaint/lazpaint.lpi | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lazpaint/lazpaint.lpi b/lazpaint/lazpaint.lpi index b058a85c..ef2fff3b 100644 --- a/lazpaint/lazpaint.lpi +++ b/lazpaint/lazpaint.lpi @@ -333,7 +333,7 @@ - + @@ -978,12 +978,6 @@ - - - - - - From 534a759ceadfd7e41cb9540a706b5dbe79dcf804 Mon Sep 17 00:00:00 2001 From: johann Date: Fri, 3 Apr 2020 12:43:51 +0200 Subject: [PATCH 53/53] version 7.0.9 --- lazpaint/lazpaint.lpi | 2 +- lazpaint/lazpaintembeddedpack.lpk | 2 +- lazpaint/lazpainttype.pas | 2 +- lazpaint/release/changelog | 28 +++++++++++++++++++ .../release/debian/linux32/DEBIAN/changelog | 28 +++++++++++++++++++ .../release/debian/linux32/DEBIAN/control | 2 +- .../release/debian/linux64/DEBIAN/changelog | 28 +++++++++++++++++++ .../release/debian/linux64/DEBIAN/control | 2 +- .../macOS/LazPaint.app/Contents/Info.plist | 4 +-- lazpaint/release/macOS/makedmg.sh | 2 +- lazpaint/release/windows/lazpaint.iss | 2 +- lazpaintcontrols/lazpaintcontrols.lpk | 11 +++----- 12 files changed, 97 insertions(+), 16 deletions(-) diff --git a/lazpaint/lazpaint.lpi b/lazpaint/lazpaint.lpi index ef2fff3b..dd4a0972 100644 --- a/lazpaint/lazpaint.lpi +++ b/lazpaint/lazpaint.lpi @@ -23,7 +23,7 @@ - + diff --git a/lazpaint/lazpaintembeddedpack.lpk b/lazpaint/lazpaintembeddedpack.lpk index ee7cf106..307c27e7 100644 --- a/lazpaint/lazpaintembeddedpack.lpk +++ b/lazpaint/lazpaintembeddedpack.lpk @@ -26,7 +26,7 @@ - + diff --git a/lazpaint/lazpainttype.pas b/lazpaint/lazpainttype.pas index 180967d9..4e2fbf30 100644 --- a/lazpaint/lazpainttype.pas +++ b/lazpaint/lazpainttype.pas @@ -10,7 +10,7 @@ interface {$IFDEF LINUX}, InterfaceBase{$ENDIF}; const - LazPaintVersion = 7000800; + LazPaintVersion = 7000900; function LazPaintVersionStr: string; diff --git a/lazpaint/release/changelog b/lazpaint/release/changelog index f18d2b3f..a7f90784 100644 --- a/lazpaint/release/changelog +++ b/lazpaint/release/changelog @@ -145,3 +145,31 @@ lazpaint (7.0.8) unstable; urgency=low -- circular Fri, 6 Mar 2020 18:32:00 +0100 +lazpaint (7.0.9) unstable; urgency=low + + * interface: less flickering during action progress + * interface: minor scaling improvements + * interface: ensure toolwindows in front when restoring app + * interface: dark theme for status bar + * interface: add Donate tool button + * interface: add Python download button if missing + * interface: separate color for background and outline + * interface: don't undock windows when going fullscreen + * interface: fix remember save file extension + * translation: added Latvian + * translation: completed Kabyle and Bulgarian + * tool: fix updating transparent colors + * tool: fix release of middle mouse button + * tool: optimize layer transform + * tool: added font aliasing option + * tool: replace layer by gradient if it is opaque + * tool: floodfill using vector if possible + * tool: fix gradient undo/redo + * tool: multiselection of shapes + * tool: fix text editor handling of keys + * script: sort in menus + * script: added inner shadow/light + * script: added version function + +-- circular Fri, 3 Apr 2020 12:40:00 +0100 + diff --git a/lazpaint/release/debian/linux32/DEBIAN/changelog b/lazpaint/release/debian/linux32/DEBIAN/changelog index f18d2b3f..a7f90784 100644 --- a/lazpaint/release/debian/linux32/DEBIAN/changelog +++ b/lazpaint/release/debian/linux32/DEBIAN/changelog @@ -145,3 +145,31 @@ lazpaint (7.0.8) unstable; urgency=low -- circular Fri, 6 Mar 2020 18:32:00 +0100 +lazpaint (7.0.9) unstable; urgency=low + + * interface: less flickering during action progress + * interface: minor scaling improvements + * interface: ensure toolwindows in front when restoring app + * interface: dark theme for status bar + * interface: add Donate tool button + * interface: add Python download button if missing + * interface: separate color for background and outline + * interface: don't undock windows when going fullscreen + * interface: fix remember save file extension + * translation: added Latvian + * translation: completed Kabyle and Bulgarian + * tool: fix updating transparent colors + * tool: fix release of middle mouse button + * tool: optimize layer transform + * tool: added font aliasing option + * tool: replace layer by gradient if it is opaque + * tool: floodfill using vector if possible + * tool: fix gradient undo/redo + * tool: multiselection of shapes + * tool: fix text editor handling of keys + * script: sort in menus + * script: added inner shadow/light + * script: added version function + +-- circular Fri, 3 Apr 2020 12:40:00 +0100 + diff --git a/lazpaint/release/debian/linux32/DEBIAN/control b/lazpaint/release/debian/linux32/DEBIAN/control index 231d5626..d3bc4c54 100644 --- a/lazpaint/release/debian/linux32/DEBIAN/control +++ b/lazpaint/release/debian/linux32/DEBIAN/control @@ -1,5 +1,5 @@ Package: lazpaint -Version: 7.0.8 +Version: 7.0.9 Section: base Priority: optional Architecture: i386 diff --git a/lazpaint/release/debian/linux64/DEBIAN/changelog b/lazpaint/release/debian/linux64/DEBIAN/changelog index f18d2b3f..a7f90784 100644 --- a/lazpaint/release/debian/linux64/DEBIAN/changelog +++ b/lazpaint/release/debian/linux64/DEBIAN/changelog @@ -145,3 +145,31 @@ lazpaint (7.0.8) unstable; urgency=low -- circular Fri, 6 Mar 2020 18:32:00 +0100 +lazpaint (7.0.9) unstable; urgency=low + + * interface: less flickering during action progress + * interface: minor scaling improvements + * interface: ensure toolwindows in front when restoring app + * interface: dark theme for status bar + * interface: add Donate tool button + * interface: add Python download button if missing + * interface: separate color for background and outline + * interface: don't undock windows when going fullscreen + * interface: fix remember save file extension + * translation: added Latvian + * translation: completed Kabyle and Bulgarian + * tool: fix updating transparent colors + * tool: fix release of middle mouse button + * tool: optimize layer transform + * tool: added font aliasing option + * tool: replace layer by gradient if it is opaque + * tool: floodfill using vector if possible + * tool: fix gradient undo/redo + * tool: multiselection of shapes + * tool: fix text editor handling of keys + * script: sort in menus + * script: added inner shadow/light + * script: added version function + +-- circular Fri, 3 Apr 2020 12:40:00 +0100 + diff --git a/lazpaint/release/debian/linux64/DEBIAN/control b/lazpaint/release/debian/linux64/DEBIAN/control index bde0d306..762e440a 100644 --- a/lazpaint/release/debian/linux64/DEBIAN/control +++ b/lazpaint/release/debian/linux64/DEBIAN/control @@ -1,5 +1,5 @@ Package: lazpaint -Version: 7.0.8 +Version: 7.0.9 Section: base Priority: optional Architecture: amd64 diff --git a/lazpaint/release/macOS/LazPaint.app/Contents/Info.plist b/lazpaint/release/macOS/LazPaint.app/Contents/Info.plist index 7d229545..fcd61217 100644 --- a/lazpaint/release/macOS/LazPaint.app/Contents/Info.plist +++ b/lazpaint/release/macOS/LazPaint.app/Contents/Info.plist @@ -19,9 +19,9 @@ CFBundleSignature lazp CFBundleShortVersionString - 7.0.8 + 7.0.9 CFBundleVersion - 7.0.8 + 7.0.9 CSResourcesFileMapped CFBundleDocumentTypes diff --git a/lazpaint/release/macOS/makedmg.sh b/lazpaint/release/macOS/makedmg.sh index ce4c3026..f040e291 100755 --- a/lazpaint/release/macOS/makedmg.sh +++ b/lazpaint/release/macOS/makedmg.sh @@ -12,7 +12,7 @@ fi appname=LazPaint -appversion=7.0.8 +appversion=7.0.9 pkgversion=0 appnamenospaces=lazpaint appbundle="$appname.app" diff --git a/lazpaint/release/windows/lazpaint.iss b/lazpaint/release/windows/lazpaint.iss index a438fa8b..4331891e 100644 --- a/lazpaint/release/windows/lazpaint.iss +++ b/lazpaint/release/windows/lazpaint.iss @@ -1,7 +1,7 @@ #define MyAppName "LazPaint" #define MyAppOutputName "lazpaint" #define MyInstallerSuffix "_setup_win32_win64" -#define MyAppVersion "7.0.8" +#define MyAppVersion "7.0.9" #define MyAppPublisher "Circular, Fabien Wang, Lainz and others" #define MyAppURL "http://sourceforge.net/projects/lazpaint/" #define MyAppExeName "lazpaint.exe" diff --git a/lazpaintcontrols/lazpaintcontrols.lpk b/lazpaintcontrols/lazpaintcontrols.lpk index d63ab08d..0de9e4fc 100644 --- a/lazpaintcontrols/lazpaintcontrols.lpk +++ b/lazpaintcontrols/lazpaintcontrols.lpk @@ -73,26 +73,23 @@ - + - + - + - - - - +