Author: ludovic
Date: 2008-01-16 23:56:29 +0100 (Wed, 16 Jan 2008)
New Revision: 6876

Modified:
   xwiki-products/curriki/trunk/web/src/main/webapp/skins/curriki8/macros.vm
Log:
CURRIKI-1193 FIx log resizing

Modified: 
xwiki-products/curriki/trunk/web/src/main/webapp/skins/curriki8/macros.vm
===================================================================
--- xwiki-products/curriki/trunk/web/src/main/webapp/skins/curriki8/macros.vm   
2008-01-16 22:35:36 UTC (rev 6875)
+++ xwiki-products/curriki/trunk/web/src/main/webapp/skins/curriki8/macros.vm   
2008-01-16 22:56:29 UTC (rev 6876)
@@ -2089,30 +2089,20 @@
   #set($logoheight = $xwiki.image.getHeight($srcdoc.fullName,$logofilename))
 #else
   #set($m_logo = $xwiki.getSkinFile("groups_default_logo.gif"))
-  ##set($logowidth = 120)
-  ##set($logoheight = 82)
 #end
-##if($logowidth > 120)
-##  #set($logowidth = 120)
-###end
-###if($logoheight > 82)
-##  #set($logoheight = 82)
-###end
-
 ## find out wich dimmension overflows the most
 #set( $image_resize = "" )
-#if( $logowidth > 120 || $logoheight > 82 )
-  #set( $ratio = $logowidth / $logoheight )
-  #set( $width_overflow = 80 * $ratio )
-  #set( $height_overflow = 120 / $ratio )
-  #if( $width_overflow > 120 )
-       #set( $image_resize = "?width=120")
-  #else
-       #set( $image_resize = "?height=82")
-  #end
+#set( $ratiox = $logowidth / 120)
+#set( $ratioy = $logoheight / 82)
+#if($ratiox>$ratioy)
+ #set($width = 120)
+ #set($height = $logoheight * 120 / $logowidth)
+ #set( $image_resize = "?width=120")
+#else
+ #set($height = 82)
+ #set($width = $logowidth * 82 / $logoheight)
+ #set( $image_resize = "?height=82")
 #end
-
-
 #if("$!first_frame_done" == "") ## {
 <div class="frame">
 #else ## } {
@@ -2130,8 +2120,7 @@
 </div>
 <div class="frame-inset-logo">
 <a href="$s.getHomeURL()" title="$s.getDisplayTitle()" 
alt="$s.getDisplayTitle()">
-##<img src="$m_logo" width="$logowidth" height="$logoheight" 
title="${s.getDisplayTitle()}" alt="${s.getDisplayTitle()}" />
-<img src="${m_logo}${image_resize}" title="${s.getDisplayTitle()}" 
alt="${s.getDisplayTitle()}" />
+<img src="${m_logo}${image_resize}" width="$width" height="$height" 
title="${s.getDisplayTitle()}" alt="${s.getDisplayTitle()}" />
 </a>
 </div>
 <div class="frame-inset-description">
@@ -2139,7 +2128,6 @@
 </div>
 </div>
 #end ## }
-'
 
 ##
 ##

_______________________________________________
notifications mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/notifications

Reply via email to