mirror of
https://github.com/fltk/fltk.git
synced 2026-05-31 13:55:38 +08:00
Fix for issue #155 - continued
The issue lies in details how floating point scaled coordinates are converted to integer values and its impact on the drawing of large SVG images. This commit fixes the X11 platform. The macOS platform is immune because drawing uses floating point coordinates. The Windows platform still needs fixing.
This commit is contained in:
@@ -236,7 +236,7 @@ protected:
|
||||
static void draw_empty(Fl_Image* img, int X, int Y) {img->draw_empty(X, Y);}
|
||||
|
||||
Fl_Graphics_Driver();
|
||||
virtual void cache_size(int &width, int &height);
|
||||
virtual void cache_size(Fl_Image *img, int &width, int &height);
|
||||
static unsigned need_pixmap_bg_color;
|
||||
public:
|
||||
virtual ~Fl_Graphics_Driver() {} ///< Destructor
|
||||
|
||||
@@ -133,6 +133,7 @@ struct NSVGimage;
|
||||
|
||||
*/
|
||||
class FL_EXPORT Fl_SVG_Image : public Fl_RGB_Image {
|
||||
friend class Fl_Graphics_Driver;
|
||||
private:
|
||||
typedef struct {
|
||||
NSVGimage* svg_image;
|
||||
@@ -146,6 +147,7 @@ private:
|
||||
float average_weight_;
|
||||
float svg_scaling_(int W, int H);
|
||||
void rasterize_(int W, int H);
|
||||
void cache_size(int &width, int &height);
|
||||
void init_(const char *filename, const char *filedata, Fl_SVG_Image *copy_source);
|
||||
Fl_SVG_Image(Fl_SVG_Image *source);
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user