[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.5/kdelibs/khtml/rendering
From:       Luís Pedro Coelho <luis () luispedro ! org>
Date:       2005-08-18 15:15:09
Message-ID: 1124378109.168083.21999.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 450584 by luis_pedro:

Fix -<img src="img.jpeg" style="max-width: 400px" />- 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;
 
     }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic