diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-02-21 21:34:11 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-02-21 21:34:27 +0100 |
| commit | dd75da6351c3e08618df3fd46a30d06582ae3163 (patch) | |
| tree | 16f2683c785cd3792c0a6cae5dbe5dfaefca8981 /src/Fl_SVG_Image.cxx | |
| parent | 07dfcd0fb79bf953773b7330334449224fa293a1 (diff) | |
Remove VS compilation warnings about implicit type conversions.
Diffstat (limited to 'src/Fl_SVG_Image.cxx')
| -rw-r--r-- | src/Fl_SVG_Image.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Fl_SVG_Image.cxx b/src/Fl_SVG_Image.cxx index 8b9f01ce5..ffdc6d2a0 100644 --- a/src/Fl_SVG_Image.cxx +++ b/src/Fl_SVG_Image.cxx @@ -162,8 +162,8 @@ void Fl_SVG_Image::init_(const char *filename, const char *in_filedata, Fl_SVG_I d(-1); ld(ERR_FORMAT); } else { - w(counted_svg_image_->svg_image->width + 0.5); - h(counted_svg_image_->svg_image->height + 0.5); + w(int(counted_svg_image_->svg_image->width + 0.5)); + h(int(counted_svg_image_->svg_image->height + 0.5)); } } else if (copy_source) { w(copy_source->w()); @@ -184,7 +184,7 @@ void Fl_SVG_Image::rasterize_(int W, int H) { fy = (double)H / counted_svg_image_->svg_image->height; } array = new uchar[W*H*4]; - nsvgRasterizeXY(rasterizer, counted_svg_image_->svg_image, 0, 0, fx, fy, (uchar* )array, W, H, W*4); + nsvgRasterizeXY(rasterizer, counted_svg_image_->svg_image, 0, 0, float(fx), float(fy), (uchar* )array, W, H, W*4); alloc_array = 1; data((const char * const *)&array, 1); d(4); @@ -240,8 +240,8 @@ void Fl_SVG_Image::cache_size_(int &width, int &height) { // Keep the rasterized image proportional to its source-level width and height // while maintaining it large enough to allow image tiling. float f = counted_svg_image_->svg_image->width / counted_svg_image_->svg_image->height; - if (height * f >= width) width = height * f + 0.5; - else height = width/f + 0.5; + if (height * f >= width) width = int(height * f + 0.5); + else height = int(width/f + 0.5); } } |
