diff options
Diffstat (limited to 'desktop/thumbnail.c')
-rw-r--r-- | desktop/thumbnail.c | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/desktop/thumbnail.c b/desktop/thumbnail.c index 5407b60bb..c8aa9de76 100644 --- a/desktop/thumbnail.c +++ b/desktop/thumbnail.c @@ -33,6 +33,28 @@ #include "utils/log.h" +/** + * Get scale at which thumbnail will be rendered for a given content and + * thumbnail size. + * + * \param content The content to redraw for thumbnail + * \param width The thumbnail width + * \return scale thumbnail will be rendered at + * + * Units for width and height are pixels. + */ +static float thumbnail_get_redraw_scale(struct hlcache_handle *content, + int width) +{ + assert(content); + + if (content_get_width(content)) + return (float)width / (float)content_get_width(content); + else + return 1.0; +} + + /* exported interface, documented in thumbnail.h */ bool thumbnail_redraw(struct hlcache_handle *content, int width, int height) @@ -73,15 +95,3 @@ bool thumbnail_redraw(struct hlcache_handle *content, return plot_ok; } - - -/* exported interface, documented in thumbnail.h */ -float thumbnail_get_redraw_scale(struct hlcache_handle *content, int width) -{ - assert(content); - - if (content_get_width(content)) - return (float)width / (float)content_get_width(content); - else - return 1.0; -} |