mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-26 15:02:50 +02:00
fix svg resize
Origin commit data
------------------
Branch: ni/coolstream
Commit: 8ced48eafd
Author: TangoCash <eric@loxat.de>
Date: 2021-11-02 (Tue, 02 Nov 2021)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -46,7 +46,7 @@ extern int fh_crw_id (const char *);
|
||||
#ifdef FBV_SUPPORT_SVG
|
||||
extern int fh_svg_getsize (const char *, int *, int *, int, int);
|
||||
extern int fh_svg_load (const char *, unsigned char **, int *, int *);
|
||||
extern int svg_load_resize(const char *name, unsigned char **buffer, int* ox, int* oy, int* dx, int* dy);
|
||||
extern int svg_load_resize(const char *name, unsigned char **buffer, int* ox, int* oy, int dx, int dy);
|
||||
extern int fh_svg_id (const char *);
|
||||
#endif
|
||||
double CPictureViewer::m_aspect_ratio_correction;
|
||||
@@ -894,7 +894,7 @@ fb_pixel_t * CPictureViewer::int_getImage(const std::string & name, int *width,
|
||||
#ifdef FBV_SUPPORT_SVG
|
||||
if (name.find(".svg") == (name.length() - 4))
|
||||
{
|
||||
svg_load_resize(name.c_str(), &buffer, &x, &y, width, height);
|
||||
svg_load_resize(name.c_str(), &buffer, &x, &y, *width, *height);
|
||||
if (x != *width || y != *height)
|
||||
buffer = ResizeA(buffer, x, y, *width, *height);
|
||||
}
|
||||
|
@@ -108,9 +108,9 @@ error:
|
||||
return 0;
|
||||
}
|
||||
|
||||
int svg_load_resize(const char *name, unsigned char **buffer, int* ox, int* oy, int* dx, int* dy);
|
||||
int svg_load_resize(const char *name, unsigned char **buffer, int* ox, int* oy, int dx, int dy);
|
||||
|
||||
int svg_load_resize(const char *name, unsigned char **buffer, int* ox, int* oy, int* dx, int* dy)
|
||||
int svg_load_resize(const char *name, unsigned char **buffer, int* ox, int* oy, int dx, int dy)
|
||||
{
|
||||
NSVGimage *image = NULL;
|
||||
NSVGrasterizer *rast = NULL;
|
||||
@@ -134,8 +134,8 @@ int svg_load_resize(const char *name, unsigned char **buffer, int* ox, int* oy,
|
||||
}
|
||||
|
||||
float scale_w,scale_h;
|
||||
scale_w = *dx/w;
|
||||
scale_h = *dy/h;
|
||||
scale_w = (float)dx/(float)w;
|
||||
scale_h = (float)dy/(float)h;
|
||||
|
||||
w = (int)(w*scale_w);
|
||||
h = (int)(h*scale_h);
|
||||
|
Reference in New Issue
Block a user