don't resize the station logo image if we don't have to
This commit is contained in:
parent
b3d8e4bf76
commit
cdfd1db671
1 changed files with 12 additions and 11 deletions
|
@ -802,7 +802,7 @@ resizeImage(Gtk::Image* image, int width, int height) throw ()
|
||||||
int imageWidth = pixbuf->get_width();
|
int imageWidth = pixbuf->get_width();
|
||||||
int imageHeight = pixbuf->get_height();
|
int imageHeight = pixbuf->get_height();
|
||||||
|
|
||||||
// this is integerese for (logoWidth/logoHeight > width/height)
|
if (imageWidth > width || imageHeight > height) {
|
||||||
if (imageWidth * height > imageHeight * width) {
|
if (imageWidth * height > imageHeight * width) {
|
||||||
// image is wide: squash horizontally
|
// image is wide: squash horizontally
|
||||||
image->set(pixbuf->scale_simple(width,
|
image->set(pixbuf->scale_simple(width,
|
||||||
|
@ -814,6 +814,7 @@ resizeImage(Gtk::Image* image, int width, int height) throw ()
|
||||||
height,
|
height,
|
||||||
Gdk::INTERP_HYPER ));
|
Gdk::INTERP_HYPER ));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue