From kde-commits Thu Aug 18 15:15:09 2005 From: =?utf-8?q?Lu=C3=ADs=20Pedro=20Coelho?= Date: Thu, 18 Aug 2005 15:15:09 +0000 To: kde-commits Subject: branches/KDE/3.5/kdelibs/khtml/rendering Message-Id: <1124378109.168083.21999.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=112437812001222 SVN commit 450584 by luis_pedro: Fix -- by scaling the image correctly (adjust both height and width). M +7 -6 render_image.cpp --- branches/KDE/3.5/kdelibs/khtml/rendering/render_image.cpp #450583:450584 @@ -502,9 +502,10 @@ const Length w = style()->width(); if (w.isVariable()) { - const Length h = style()->height(); - if ( m_intrinsicHeight > 0 && ( h.isPercent() || h.isFixed() ) ) - return ( ( h.isPercent() ? calcReplacedHeight() : h.value() )*intrinsicWidth() ) / m_intrinsicHeight; + int h = RenderReplaced::calcReplacedHeight(); + if (m_intrinsicHeight > 0 && h!= m_intrinsicHeight) { + return (h*intrinsicWidth())/m_intrinsicHeight; + } } return RenderReplaced::calcReplacedWidth(); @@ -515,9 +516,9 @@ const Length h = style()->height(); if (h.isVariable()) { - const Length w = style()->width(); - if( m_intrinsicWidth > 0 && ( w.isFixed() || w.isPercent() )) - return (( w.isPercent() ? calcReplacedWidth() : w.value() ) * intrinsicHeight()) / m_intrinsicWidth; + int w = RenderReplaced::calcReplacedWidth(); + if( m_intrinsicWidth > 0 && w != m_intrinsicWidth ) + return (w*intrinsicHeight())/m_intrinsicWidth; }