diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-02-24 14:52:36 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-02-24 14:52:47 +0100 |
| commit | bef46b5cb82464713a117b9bdb920735d1b7de37 (patch) | |
| tree | e645da2fdd342a8a8a41c90b54b2e96e29d849a0 /src/Fl_Graphics_Driver.cxx | |
| parent | 9f84fd05e8090c3b7554c965d15ac5c41a0d4852 (diff) | |
Improve precision of GUI scaling for Windows platform.
Diffstat (limited to 'src/Fl_Graphics_Driver.cxx')
| -rw-r--r-- | src/Fl_Graphics_Driver.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/Fl_Graphics_Driver.cxx b/src/Fl_Graphics_Driver.cxx index ec3cc8d78..2f687e151 100644 --- a/src/Fl_Graphics_Driver.cxx +++ b/src/Fl_Graphics_Driver.cxx @@ -211,6 +211,10 @@ void Fl_Graphics_Driver::cache_size(Fl_Image *img, int &width, int &height) fs = height * s; height = (fs - int(fs) < 0.001 ? int(fs) : int((height+1) * s)); + cache_size_finalize(img, width, height); +} + +void Fl_Graphics_Driver::cache_size_finalize(Fl_Image *img, int &width, int &height) { if (img) img->cache_size_(width, height); } @@ -754,6 +758,10 @@ void Fl_Scalable_Graphics_Driver::font(Fl_Font face, Fl_Fontsize size) { font_unscaled(face, Fl_Fontsize(size * scale())); } +Fl_Font Fl_Scalable_Graphics_Driver::font() { + return Fl_Graphics_Driver::font(); +} + double Fl_Scalable_Graphics_Driver::width(const char *str, int n) { return width_unscaled(str, n)/scale(); } @@ -790,6 +798,10 @@ void Fl_Scalable_Graphics_Driver::draw(const char *str, int n, int x, int y) { unscale_clip(r2); } +void Fl_Scalable_Graphics_Driver::draw(const char *str, int n, float x, float y) { + Fl_Graphics_Driver::draw(str, n, x, y); +} + void Fl_Scalable_Graphics_Driver::draw(int angle, const char *str, int n, int x, int y) { if (!size_ || !font_descriptor()) font(FL_HELVETICA, FL_NORMAL_SIZE); Fl_Region r2 = scale_clip(scale()); @@ -805,6 +817,10 @@ void Fl_Scalable_Graphics_Driver::arc(int x,int y,int w,int h,double a1,double a arc_unscaled(x * scale(), y * scale(), w * scale(), h * scale(), a1, a2); } +void Fl_Scalable_Graphics_Driver::arc(double x, double y, double r, double start, double end) { + Fl_Graphics_Driver::arc(x, y, r, start, end); +} + void Fl_Scalable_Graphics_Driver::pie(int x,int y,int w,int h,double a1,double a2) { pie_unscaled(x * scale(), y * scale(), w * scale(), h * scale(), a1, a2); } |
