diff options
author | Stijn Buys <ingar@osirion.org> | 2013-12-17 21:28:15 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2013-12-17 21:28:15 +0000 |
commit | c7f28c2c0c7d23712552f0cd6ea0cf462068e081 (patch) | |
tree | c5e1b21d7362ae923283bc766115725fb97b6759 /src/ui/bitmap.cc | |
parent | 765d03abb9f031a9d608edaeb0f0f1bd6eded591 (diff) |
Added a preserve_attribute option to the ui::Paint::print_bitmap() functions and the ui::Bitmap class,
preserve aspect ratio on the loader screen image and the main menu background.
Diffstat (limited to 'src/ui/bitmap.cc')
-rw-r--r-- | src/ui/bitmap.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ui/bitmap.cc b/src/ui/bitmap.cc index 03d7166..5caf966 100644 --- a/src/ui/bitmap.cc +++ b/src/ui/bitmap.cc @@ -16,6 +16,7 @@ Bitmap::Bitmap(Widget *parent, const char *texture) : Widget(parent) { set_border(false); set_background(true); + set_preserve_aspect(false); set_label("bitmap"); set_texture(texture); @@ -48,10 +49,15 @@ void Bitmap::set_color(const math::Color & color) bitmap_color.assign(color); } +void Bitmap::set_preserve_aspect(const bool preserve_aspect) +{ + bitmap_preserve_aspect = preserve_aspect; +} + void Bitmap::draw_background() { if (bitmap_texture.size()) { - Paint::draw_bitmap(global_location(), size(),bitmap_color, bitmap_texture); + Paint::draw_bitmap(global_location(), size(), bitmap_color, bitmap_texture, bitmap_preserve_aspect); } } |