diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-09-17 09:03:34 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-09-17 09:03:34 +0200 |
| commit | eb314f565340ff69922710d281d02b709ca77548 (patch) | |
| tree | 9318728472020393325773de88e07c3218d07db9 /src/Fl_x.cxx | |
| parent | 166a5bf785dab6b2319e0ac0711d8ce08e514b0c (diff) | |
Allow use of Fl_Window::default_icon() with a scaled image - Part 2.
Default icons are handled according to their scaled size, if there scaled.
Diffstat (limited to 'src/Fl_x.cxx')
| -rw-r--r-- | src/Fl_x.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index e5c970b0a..5b7e2a731 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -2707,6 +2707,11 @@ static void icons_to_property(const Fl_RGB_Image *icons[], int count, const Fl_RGB_Image *image; image = icons[i]; + bool need_delete = false; + if (image->w() != image->data_w() || image->h() != image->data_h()) { + image = (Fl_RGB_Image*)image->copy(); + need_delete = true; + } data[0] = image->data_w(); data[1] = image->data_h(); @@ -2736,6 +2741,7 @@ static void icons_to_property(const Fl_RGB_Image *icons[], int count, } in += extra_data; } + if (need_delete) delete image; } } |
