diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2020-02-22 07:15:08 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2020-02-22 07:15:08 +0100 |
| commit | e18de6ff0306489460879f5d805eb8d00f95cf95 (patch) | |
| tree | 997ba1234d3e9c976b356d673f9cf047e40d308a /src/Fl_Image.cxx | |
| parent | 2d2c2ff45e8dae3e0ca52dffdd2e19af505d5667 (diff) | |
Fix the Fl_RGB_Image(Fl_Pixmap *pxm) c'tor when pxm is scaled.
Diffstat (limited to 'src/Fl_Image.cxx')
| -rw-r--r-- | src/Fl_Image.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Fl_Image.cxx b/src/Fl_Image.cxx index b02d43f75..dcffe3561 100644 --- a/src/Fl_Image.cxx +++ b/src/Fl_Image.cxx @@ -366,19 +366,20 @@ Fl_RGB_Image::Fl_RGB_Image(const uchar *bits, int W, int H, int D, int LD) : image is destroyed. */ Fl_RGB_Image::Fl_RGB_Image(const Fl_Pixmap *pxm, Fl_Color bg): - Fl_Image(pxm->w(), pxm->h(), 4), + Fl_Image(pxm->data_w(), pxm->data_h(), 4), array(0), alloc_array(0), id_(0), mask_(0), cache_w_(0), cache_h_(0) { - if (pxm && pxm->w() > 0 && pxm->h() > 0) { - array = new uchar[w() * h() * d()]; + if (pxm && pxm->data_w() > 0 && pxm->data_h() > 0) { + array = new uchar[data_w() * data_h() * d()]; alloc_array = 1; fl_convert_pixmap(pxm->data(), (uchar*)array, bg); } data((const char **)&array, 1); + scale(pxm->w(), pxm->h(), 0, 1); } |
