fpvectorial: Fixes reading huge DXF map files

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1548 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
sekelsenmat 2011-04-02 17:58:44 +00:00
parent c3e6a6e8eb
commit b7777efdb9
3 changed files with 5 additions and 4 deletions

View File

@ -1056,7 +1056,6 @@ begin
if not IsReadingPolyline then raise Exception.Create('[TvDXFVectorialReader.ReadENTITIES_VERTEX] Unexpected record: VERTEX before a POLYLINE');
curPoint := Length(Polyline);
Inc(curPoint);
SetLength(Polyline, curPoint+1);
for i := 0 to ATokens.Count - 1 do
@ -1094,7 +1093,7 @@ begin
{$ifdef FPVECTORIALDEBUG_POLYLINE}
Write(Format('POLYLINE %f,%f', [Polyline[0].X, Polyline[0].Y]));
{$endif}
for i := 1 to Length(Polyline) do
for i := 1 to Length(Polyline)-1 do
begin
AData.AddLineToPath(Polyline[i].X, Polyline[i].Y);
{$ifdef FPVECTORIALDEBUG_POLYLINE}

View File

@ -76,8 +76,8 @@ object frmFPVViewer: TfrmFPVViewer
object pageViewer: TPage
end
object Page2: TPage
ClientWidth = 264
ClientHeight = 312
ClientWidth = 528
ClientHeight = 624
object DXFTreeView: TTreeView
Left = 8
Height = 313

View File

@ -75,10 +75,12 @@ begin
if Vec.Width * spinScale.Value > FPVVIEWER_MAX_IMAGE_SIZE then CanvasSize.X := FPVVIEWER_MAX_IMAGE_SIZE
else if Vec.Width < FPVVIEWER_MIN_IMAGE_SIZE then CanvasSize.X := Drawer.Width
else CanvasSize.X := Round(Vec.Width * spinScale.Value);
if CanvasSize.X < Drawer.Width then CanvasSize.X := Drawer.Width;
if Vec.Height * spinScale.Value > FPVVIEWER_MAX_IMAGE_SIZE then CanvasSize.Y := FPVVIEWER_MAX_IMAGE_SIZE
else if Vec.Height < FPVVIEWER_MIN_IMAGE_SIZE then CanvasSize.Y := Drawer.Height
else CanvasSize.Y := Round(Vec.Height * spinScale.Value);
if CanvasSize.Y < Drawer.Height then CanvasSize.Y := Drawer.Height;
Drawer.Drawing.Width := CanvasSize.X;
Drawer.Drawing.Height := CanvasSize.Y;