widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #09414
[Merge] lp:~widelands-dev/widelands/tab_panel_fuzzy_images into lp:widelands
GunChleoc has proposed merging lp:~widelands-dev/widelands/tab_panel_fuzzy_images into lp:widelands.
Commit message:
Fixed fuzzy tab images in tabpanel.
Requested reviews:
Widelands Developers (widelands-dev)
For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/tab_panel_fuzzy_images/+merge/315294
The fuzziness is noticeable with the medium buildings icon in the Building Statistics window.
--
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/tab_panel_fuzzy_images into lp:widelands.
=== modified file 'src/ui_basic/tabpanel.cc'
--- src/ui_basic/tabpanel.cc 2016-10-25 08:11:31 +0000
+++ src/ui_basic/tabpanel.cc 2017-01-21 15:32:20 +0000
@@ -289,19 +289,19 @@
// Scale the image down if needed, but keep the ratio.
constexpr int kMaxImageSize = kTabPanelButtonHeight - 2 * kTabPanelImageMargin;
double image_scale =
- std::min(1., std::min(static_cast<double>(kMaxImageSize) / tabs_[idx]->pic->width(),
+ std::min(1., std::min(static_cast<double>(kMaxImageSize) / tabs_[idx]->pic->width(),
static_cast<double>(kMaxImageSize) / tabs_[idx]->pic->height()));
uint16_t picture_width = image_scale * tabs_[idx]->pic->width();
uint16_t picture_height = image_scale * tabs_[idx]->pic->height();
dst.blitrect_scale(
- Rectf(x + (kTabPanelButtonHeight - picture_width) / 2.f,
- (kTabPanelButtonHeight - picture_height) / 2.f, picture_width, picture_height),
- tabs_[idx]->pic, Recti(0, 0, tabs_[idx]->pic->width(), tabs_[idx]->pic->height()), 1.,
+ Rectf(x + (kTabPanelButtonHeight - picture_width) / 2,
+ (kTabPanelButtonHeight - picture_height) / 2, picture_width, picture_height),
+ tabs_[idx]->pic, Recti(0, 0, tabs_[idx]->pic->width(), tabs_[idx]->pic->height()), 1,
BlendMode::UseAlpha);
} else {
dst.blit(Vector2f(x + kTabPanelTextMargin,
- (kTabPanelButtonHeight - tabs_[idx]->pic->height()) / 2.f),
+ (kTabPanelButtonHeight - tabs_[idx]->pic->height()) / 2),
tabs_[idx]->pic, BlendMode::UseAlpha, UI::Align::kLeft);
}
Follow ups