Author: stephane
Date: 2007-12-14 10:07:54 -0500 (Fri, 14 Dec 2007)
New Revision: 91290

Modified:
   trunk/moon/src/ChangeLog
   trunk/moon/src/media.cpp
Log:
2007-12-14  Stephane Delcroix  <[EMAIL PROTECTED]>

        * brush.cpp: Fix for bnc 346204: Set both Width and Height for Image if
        only one (Width XOR Height) is provided.


Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog    2007-12-14 14:58:48 UTC (rev 91289)
+++ trunk/moon/src/ChangeLog    2007-12-14 15:07:54 UTC (rev 91290)
@@ -1,3 +1,8 @@
+2007-12-14  Stephane Delcroix  <[EMAIL PROTECTED]>
+
+       * brush.cpp: Fix for bnc 346204: Set both Width and Height for Image if
+       only one (Width XOR Height) is provided.
+
 2007-12-14  Sebastien Pouliot  <[EMAIL PROTECTED]> 
 
        * shape.cpp: Fix Path::GetBrushSize to ensure the geometry has

Modified: trunk/moon/src/media.cpp
===================================================================
--- trunk/moon/src/media.cpp    2007-12-14 14:58:48 UTC (rev 91289)
+++ trunk/moon/src/media.cpp    2007-12-14 15:07:54 UTC (rev 91290)
@@ -1257,12 +1257,18 @@
        if (!ok)
                return;
 
-       if (GetValueNoDefault (FrameworkElement::WidthProperty) == NULL)
+       Value *width = GetValueNoDefault (FrameworkElement::WidthProperty);
+       Value *height = GetValueNoDefault (FrameworkElement::HeightProperty);
+
+       if (width == NULL && height == NULL) {
                SetValue (FrameworkElement::WidthProperty, (double) 
surface->width);
-
-       if (GetValueNoDefault (FrameworkElement::HeightProperty) == NULL)
                SetValue (FrameworkElement::HeightProperty, (double) 
surface->height);
-
+       }
+       if (width == NULL && height != NULL)
+               SetValue (FrameworkElement::WidthProperty, (double) 
surface->width * height->AsDouble () / (double)surface->height);
+       if (width != NULL && height == NULL)
+               SetValue (FrameworkElement::HeightProperty, (double) 
surface->height * width->AsDouble () / (double)surface->width);
+               
        if (brush)
                brush->OnPropertyChanged (ImageBrush::DownloadProgressProperty);
        else 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to