Commit dd1bacfd authored by Murray Cumming's avatar Murray Cumming
Browse files

ImageGlom: Another scaling fix.

* glom/utility_widgets/imageglom.cc: get_scaled_image(): Don't return
an empty pixbuf just because the pixbuf doesn't not need to change.
parent 86891b03
2011-07-14 Murray Cumming <murrayc@murrayc.com>
ImageGlom: Another scaling fix.
* glom/utility_widgets/imageglom.cc: get_scaled_image(): Don't return
an empty pixbuf just because the pixbuf doesn't not need to change.
2011-07-14 Murray Cumming <murrayc@murrayc.com>
ImageGlom: Remove limits so we always scale, and use on_size_allocate().
......
......@@ -413,7 +413,7 @@ Glib::RefPtr<Gdk::Pixbuf> ImageGlom::get_scaled_image()
Glib::RefPtr<Gdk::Pixbuf> pixbuf_scaled = Utils::image_scale_keeping_ratio(pixbuf, allocation_height, allocation_width);
//Don't set a new pixbuf if the dimensions have not changed:
Glib::RefPtr<const Gdk::Pixbuf> pixbuf_in_image;
Glib::RefPtr<Gdk::Pixbuf> pixbuf_in_image;
if(m_image.get_storage_type() == Gtk::IMAGE_PIXBUF) //Prevent warning.
pixbuf_in_image = m_image.get_pixbuf();
......@@ -432,7 +432,10 @@ Glib::RefPtr<Gdk::Pixbuf> ImageGlom::get_scaled_image()
}
else
{
//std::cout << "scaled image not used." << std::endl;
//Return the existing one,
//instead of a new one with the same contents,
//so no unnecessary changes will be triggered.
return pixbuf_in_image;
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment