diff options
| author | Manolo Gouy <Manolo> | 2018-04-19 08:29:33 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2018-04-19 08:29:33 +0000 |
| commit | eb3664edf14c10d9f69b8f8d59ef909014f2a443 (patch) | |
| tree | bd5676df2e82939240784757063d813f853901ae /src/Fl_Graphics_Driver.cxx | |
| parent | 0196998ea609e0f182df043d35312a32748234ed (diff) | |
Documentation: add doc for Fl_Graphics_Driver::cache_size()
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12856 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Graphics_Driver.cxx')
| -rw-r--r-- | src/Fl_Graphics_Driver.cxx | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/src/Fl_Graphics_Driver.cxx b/src/Fl_Graphics_Driver.cxx index bdf9fc64b..9d5ea1a25 100644 --- a/src/Fl_Graphics_Driver.cxx +++ b/src/Fl_Graphics_Driver.cxx @@ -196,6 +196,20 @@ bool Fl_Graphics_Driver::overlay_rect_unscaled() return (scale() == int(scale())); } +/** Converts \p width and \p height from FLTK units to drawing units. + The conversion performed consists in multiplying \p width and \p height by + scale() and in slightly modifying that to help support tiled images. */ +void Fl_Graphics_Driver::cache_size(Fl_Image *img, int &width, int &height) +{ + if ( int(scale_) == scale_ ) { + width = width * scale_; + height = height * scale_; + } else { + width = (width+1) * scale_; + height = (height+1) * scale_; + } +} + #ifndef FL_DOXYGEN Fl_Font_Descriptor::Fl_Font_Descriptor(const char* name, Fl_Fontsize Size) { next = 0; @@ -299,17 +313,6 @@ void Fl_Scalable_Graphics_Driver::circle(double x, double y, double r) { ellipse_unscaled(xt*scale_, yt*scale_, rx*scale_, ry*scale_); } -// compute width & height of cached image so it can be tiled without undrawn gaps when scaling output -void Fl_Graphics_Driver::cache_size(Fl_Image *img, int &width, int &height) -{ - if ( int(scale_) == scale_ ) { - width = width * scale_; - height = height * scale_; - } else { - width = (width+1) * scale_; - height = (height+1) * scale_; - } -} void Fl_Graphics_Driver::draw_pixmap(Fl_Pixmap *pxm, int XP, int YP, int WP, int HP, int cx, int cy) { |
