From: Václav Slavík Date: Sat, 27 Oct 2001 22:25:37 +0000 (+0000) Subject: fix for animated GIFs with frames of different dimensions X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/2d963ba2cb9833ba0d3210a12f3c396d0853b1fd fix for animated GIFs with frames of different dimensions git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12185 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/html/m_image.cpp b/src/html/m_image.cpp index 396edda93d..3f479801f6 100644 --- a/src/html/m_image.cpp +++ b/src/html/m_image.cpp @@ -24,6 +24,7 @@ #include "wx/dc.h" #include "wx/scrolwin.h" #include "wx/timer.h" + #include "wx/dcmemory.h" #endif #include "wx/html/forcelnk.h" @@ -448,7 +449,17 @@ void wxHtmlImageCell::AdvanceAnimation(wxTimer *timer) if ( m_window->GetClientRect().Intersects(rect) && m_gifDecoder->ConvertToImage(&img) ) { - SetImage(img); + if ( (int)m_gifDecoder->GetWidth() != m_Width || + (int)m_gifDecoder->GetHeight() != m_Height || + m_gifDecoder->GetLeft() != 0 || m_gifDecoder->GetTop() != 0 ) + { + wxBitmap bmp(img); + wxMemoryDC dc; + dc.SelectObject(*m_bitmap); + dc.DrawBitmap(bmp, m_gifDecoder->GetLeft(), m_gifDecoder->GetTop()); + } + else + SetImage(img); m_window->Refresh(img.HasMask(), &rect); }