Skip to content

Commit

Permalink
Merge pull request #196 from TheMorc/patch-keep_aspect_ratio
Browse files Browse the repository at this point in the history
keep aspect ratio in LazyImage
  • Loading branch information
ouwou authored Jul 23, 2023
2 parents 857e94a + 0b918a7 commit 1bb9ac8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/lazyimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ bool LazyImage::OnDraw(const Cairo::RefPtr<Cairo::Context> &context) {
Abaddon::Get().GetImageManager().LoadAnimationFromURL(m_url, m_width, m_height, sigc::track_obj(cb, *this));
} else {
auto cb = [this](const Glib::RefPtr<Gdk::Pixbuf> &pb) {
property_pixbuf() = pb->scale_simple(m_width, m_height, Gdk::INTERP_BILINEAR);
int cw, ch;
GetImageDimensions(pb->get_width(), pb->get_height(), cw, ch, m_width, m_height);
property_pixbuf() = pb->scale_simple(cw, ch, Gdk::INTERP_BILINEAR);
};

Abaddon::Get().GetImageManager().LoadFromURL(m_url, sigc::track_obj(cb, *this));
Expand Down

0 comments on commit 1bb9ac8

Please sign in to comment.