FLTK logo

[master] df9749e - Fix for issue #155 "SVG rendering spoiled by scaling".

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] df9749e - Fix for issue #155 "SVG rendering spoiled by scaling". "ManoloFLTK" Nov 10, 2020  
 
commit df9749e6a8a72da60d80d9f519377f3c12a9409e
Author:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
AuthorDate: Tue Nov 10 21:03:35 2020 +0100
Commit:     ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>
CommitDate: Tue Nov 10 21:03:48 2020 +0100

    Fix for issue #155 "SVG rendering spoiled by scaling".

 src/Fl_Image.cxx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git src/Fl_Image.cxx src/Fl_Image.cxx
index c09a77f..d38148c 100644
--- src/Fl_Image.cxx
+++ src/Fl_Image.cxx
@@ -275,8 +275,8 @@ void Fl_Image::scale(int width, int height, int proportional, int can_expand)
     if (fw < 1) fw = 1;
     if (fh < 1) fh = 1;
   }
-  w_ = int(data_w() / fw);
-  h_ = int(data_h() / fh);
+  w_ = int((data_w() / fw) + 0.5);
+  h_ = int((data_h() / fh) + 0.5);
 }
 
 /** Draw the image to the current drawing surface rescaled to a given width and height.
Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.