|
@@ -58,6 +58,8 @@ type
|
|
class var sourceLayerId: integer;
|
|
class var sourceLayerId: integer;
|
|
class var sourcePosition: TPoint;
|
|
class var sourcePosition: TPoint;
|
|
class var sourcePositionRelative: boolean;
|
|
class var sourcePositionRelative: boolean;
|
|
|
|
+ class var sourceFlattened: boolean;
|
|
|
|
+ class var sourceDefined: boolean;
|
|
function PickColorWithShift: boolean; override;
|
|
function PickColorWithShift: boolean; override;
|
|
function DrawBrushAt(toolDest: TBGRABitmap; x, y: single): TRect; override;
|
|
function DrawBrushAt(toolDest: TBGRABitmap; x, y: single): TRect; override;
|
|
procedure PrepareBrush(rightBtn: boolean); override;
|
|
procedure PrepareBrush(rightBtn: boolean); override;
|
|
@@ -95,10 +97,18 @@ begin
|
|
sourcePosition := Point(round(x) + sourceOfs.x,round(y) + sourceOfs.y);
|
|
sourcePosition := Point(round(x) + sourceOfs.x,round(y) + sourceOfs.y);
|
|
sourceLayerId := Manager.Image.LayerId[Manager.Image.CurrentLayerIndex];
|
|
sourceLayerId := Manager.Image.LayerId[Manager.Image.CurrentLayerIndex];
|
|
sourcePositionRelative:= false;
|
|
sourcePositionRelative:= false;
|
|
|
|
+ sourceFlattened := ssShift in ShiftState;
|
|
|
|
+ sourceDefined := true;
|
|
result := OnlyRenderChange;
|
|
result := OnlyRenderChange;
|
|
end else
|
|
end else
|
|
begin
|
|
begin
|
|
- if (ssShift in ShiftState) then
|
|
|
|
|
|
+ if not sourceDefined then
|
|
|
|
+ begin
|
|
|
|
+ Manager.ToolPopup(tpmRightClickForSource, 0, true);
|
|
|
|
+ result := EmptyRect;
|
|
|
|
+ exit;
|
|
|
|
+ end;
|
|
|
|
+ if (ssShift in ShiftState) or sourceFlattened then
|
|
begin
|
|
begin
|
|
source := Manager.Image.RenderedImage;
|
|
source := Manager.Image.RenderedImage;
|
|
sourceOfs := Point(0,0);
|
|
sourceOfs := Point(0,0);
|
|
@@ -107,6 +117,7 @@ begin
|
|
sourceIdx := Manager.Image.GetLayerIndexById(sourceLayerId);
|
|
sourceIdx := Manager.Image.GetLayerIndexById(sourceLayerId);
|
|
if sourceIdx = -1 then
|
|
if sourceIdx = -1 then
|
|
begin
|
|
begin
|
|
|
|
+ Manager.ToolPopup(tpmRightClickForSource, 0, true);
|
|
result := EmptyRect;
|
|
result := EmptyRect;
|
|
exit;
|
|
exit;
|
|
end;
|
|
end;
|
|
@@ -188,8 +199,8 @@ var sourcePosF: TPointF;
|
|
begin
|
|
begin
|
|
Result:=inherited Render(VirtualScreen, VirtualScreenWidth,
|
|
Result:=inherited Render(VirtualScreen, VirtualScreenWidth,
|
|
VirtualScreenHeight, BitmapToVirtualScreen);
|
|
VirtualScreenHeight, BitmapToVirtualScreen);
|
|
- if not sourcePositionRelative and
|
|
|
|
- (Manager.Image.LayerBitmapById[sourceLayerId] <> nil) then
|
|
|
|
|
|
+ if not sourcePositionRelative and (sourceFlattened or
|
|
|
|
+ (Manager.Image.LayerBitmapById[sourceLayerId] <> nil)) then
|
|
begin
|
|
begin
|
|
sourcePosF := BitmapToVirtualScreen(PointF(sourcePosition.X mod Manager.Image.Width,
|
|
sourcePosF := BitmapToVirtualScreen(PointF(sourcePosition.X mod Manager.Image.Width,
|
|
sourcePosition.Y mod Manager.Image.Height));
|
|
sourcePosition.Y mod Manager.Image.Height));
|