|
@@ -93,7 +93,7 @@ implementation
|
|
|
|
|
|
uses Controls, Dialogs, UResourceStrings, UObject3D,
|
|
uses Controls, Dialogs, UResourceStrings, UObject3D,
|
|
ULoadImage, UGraph, UClipboard, Types, BGRAGradientOriginal,
|
|
ULoadImage, UGraph, UClipboard, Types, BGRAGradientOriginal,
|
|
- BGRATransform, ULoading, math, LCVectorClipboard;
|
|
|
|
|
|
+ BGRATransform, ULoading, math, LCVectorClipboard, LCVectorOriginal;
|
|
|
|
|
|
{ TImageActions }
|
|
{ TImageActions }
|
|
|
|
|
|
@@ -1248,25 +1248,37 @@ end;
|
|
|
|
|
|
function TImageActions.PasteAsNewLayer: integer;
|
|
function TImageActions.PasteAsNewLayer: integer;
|
|
var partial: TBGRABitmap;
|
|
var partial: TBGRABitmap;
|
|
|
|
+ orig: TVectorOriginal;
|
|
begin
|
|
begin
|
|
result := -1;
|
|
result := -1;
|
|
try
|
|
try
|
|
- partial := GetBitmapFromClipboard;
|
|
|
|
- if partial<>nil then
|
|
|
|
|
|
+ if ClipboardHasShapes then
|
|
begin
|
|
begin
|
|
- if partial.NbPixels <> 0 then
|
|
|
|
- begin
|
|
|
|
- AddLayerFromBitmap(partial,'');
|
|
|
|
- ChooseTool(ptMoveLayer);
|
|
|
|
|
|
+ orig := TVectorOriginal.Create;
|
|
|
|
+ PasteShapesFromClipboard(orig, AffineMatrixIdentity);
|
|
|
|
+ if AddLayerFromOriginal(orig, '') then
|
|
result := Image.LayerId[Image.CurrentLayerIndex];
|
|
result := Image.LayerId[Image.CurrentLayerIndex];
|
|
- end
|
|
|
|
- else
|
|
|
|
- partial.Free;
|
|
|
|
|
|
+ end else
|
|
|
|
+ begin
|
|
|
|
+ partial := GetBitmapFromClipboard;
|
|
|
|
+ if partial<>nil then
|
|
|
|
+ begin
|
|
|
|
+ if partial.NbPixels <> 0 then
|
|
|
|
+ begin
|
|
|
|
+ AddLayerFromBitmap(partial,'');
|
|
|
|
+ ChooseTool(ptMoveLayer);
|
|
|
|
+ result := Image.LayerId[Image.CurrentLayerIndex];
|
|
|
|
+ end
|
|
|
|
+ else
|
|
|
|
+ partial.Free;
|
|
|
|
+ end else
|
|
end;
|
|
end;
|
|
except
|
|
except
|
|
on ex:Exception do
|
|
on ex:Exception do
|
|
FInstance.ShowError('Paste',ex.Message);
|
|
FInstance.ShowError('Paste',ex.Message);
|
|
end;
|
|
end;
|
|
|
|
+ finally
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TImageActions.SelectAll;
|
|
procedure TImageActions.SelectAll;
|