mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-06 18:18:18 +02:00
fpvectorial: Now BLOCK and INSERT already started to work together
git-svn-id: trunk@39025 -
This commit is contained in:
parent
1ce12a8760
commit
c74a28fe63
@ -491,15 +491,21 @@ type
|
|||||||
function GetNextEntity: TvEntity;
|
function GetNextEntity: TvEntity;
|
||||||
procedure AddEntity(AEntity: TvEntity);
|
procedure AddEntity(AEntity: TvEntity);
|
||||||
procedure Clear;
|
procedure Clear;
|
||||||
|
//
|
||||||
|
// Never add a Render() procedure to TvBlock, because blocks are invisible!
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{@@
|
{@@
|
||||||
A "Insert" inserts a block into the drawing in the specified position
|
A "Insert" inserts a block into the drawing in the specified position
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{ TvInsert }
|
||||||
|
|
||||||
TvInsert = class(TvEntity)
|
TvInsert = class(TvEntity)
|
||||||
public
|
public
|
||||||
Block: TvBlock; // The block to be inserted
|
Block: TvBlock; // The block to be inserted
|
||||||
|
procedure Render(ADest: TFPCustomCanvas; ADestX: Integer = 0;
|
||||||
|
ADestY: Integer = 0; AMulX: Double = 1.0; AMulY: Double = 1.0); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TvVectorialDocument }
|
{ TvVectorialDocument }
|
||||||
@ -2255,6 +2261,31 @@ begin
|
|||||||
FElements.Clear;
|
FElements.Clear;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TvInsert }
|
||||||
|
|
||||||
|
procedure TvInsert.Render(ADest: TFPCustomCanvas; ADestX: Integer;
|
||||||
|
ADestY: Integer; AMulX: Double; AMulY: Double);
|
||||||
|
var
|
||||||
|
lEntity: TvEntity;
|
||||||
|
begin
|
||||||
|
inherited Render(ADest, ADestX, ADestY, AMulX, AMulY);
|
||||||
|
if Block = nil then Exit;
|
||||||
|
lEntity := Block.GetFirstEntity();
|
||||||
|
while lEntity <> nil do
|
||||||
|
begin
|
||||||
|
// Alter the position of the elements to consider the positioning of the BLOCK and of the INSERT
|
||||||
|
lEntity.X := lEntity.X + Block.X + X;
|
||||||
|
lEntity.Y := lEntity.Y + Block.Y + Y;
|
||||||
|
// Render
|
||||||
|
lEntity.Render(ADest, ADestX, ADestY, AMulX, AMuly);
|
||||||
|
// Change them back
|
||||||
|
lEntity.X := lEntity.X - Block.X - X;
|
||||||
|
lEntity.Y := lEntity.Y - Block.Y - Y;
|
||||||
|
|
||||||
|
lEntity := Block.GetNextEntity();
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
{ TvVectorialPage }
|
{ TvVectorialPage }
|
||||||
|
|
||||||
procedure TvVectorialPage.ClearTmpPath;
|
procedure TvVectorialPage.ClearTmpPath;
|
||||||
|
Loading…
Reference in New Issue
Block a user