From a849e63ce3e607ab4b55c3a795de3ed46dc063aa Mon Sep 17 00:00:00 2001 From: sekelsenmat Date: Thu, 10 Feb 2011 08:32:49 +0000 Subject: [PATCH] Improves the viewer git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1492 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- applications/fpvviewer/fpvv_mainform.pas | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/applications/fpvviewer/fpvv_mainform.pas b/applications/fpvviewer/fpvv_mainform.pas index c359d90d8..7fbb7e668 100644 --- a/applications/fpvviewer/fpvv_mainform.pas +++ b/applications/fpvviewer/fpvv_mainform.pas @@ -62,11 +62,18 @@ begin notebook.PageIndex := 0; + Drawer.Clear; + Vec := TvVectorialDocument.Create; try Vec.ReadFromFile(editFileName.FileName, vfDXF); - Drawer.Drawing.Width := Round(Vec.Width); - Drawer.Drawing.Height := Round(Vec.Height); + + // We need to be robust, because sometimes the document size won't be given + if Vec.Width < 100 then Vec.Width := Drawer.Width; + if Vec.Height < 100 then Vec.Height := Drawer.Height; + + Drawer.Drawing.Width := Round(Vec.Width * spinScale.Value); + Drawer.Drawing.Height := Round(Vec.Height * spinScale.Value); Drawer.Drawing.Canvas.Brush.Color := clWhite; Drawer.Drawing.Canvas.FillRect(0, 0, Drawer.Drawing.Width, Drawer.Drawing.Height); DrawFPVectorialToCanvas(