[Webkit-unassigned] [Bug 5966] <image> does not preserveAspectRatio

bugzilla-daemon at opendarwin.org bugzilla-daemon at opendarwin.org
Tue Feb 28 18:00:29 PST 2006


http://bugzilla.opendarwin.org/show_bug.cgi?id=5966


mjs at apple.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #6779|review?                     |review-
               Flag|                            |




------- Comment #6 from mjs at apple.com  2006-02-28 18:00 PDT -------
(From update of attachment 6779)
+        if (origDestWidth > (origDestHeight / widthToHeightMultiplier)) {
+            destRect.setWidth(origDestHeight / widthToHeightMultiplier);
+            switch(aspectRatio->align()) {
+                case SVG_PRESERVEASPECTRATIO_XMINYMID:
+                case SVG_PRESERVEASPECTRATIO_XMIDYMID:
+                case SVG_PRESERVEASPECTRATIO_XMAXYMID:
+                    destRect.setX(origDestWidth / 2 - destRect.width() / 2);
+                    break;
+                case SVG_PRESERVEASPECTRATIO_XMINYMAX:
+                case SVG_PRESERVEASPECTRATIO_XMIDYMAX:
+                case SVG_PRESERVEASPECTRATIO_XMAXYMAX:
+                    destRect.setX(origDestWidth - destRect.width());
+                    break;
+            }
+        }

I think this part is wrong, I think it should be grouping the switch blocks by
XMID and XMAX, not YMID and YMAX. Shouldn't it? The other setX branch does
that. Other than this apparent bug, looks fine.

r- for the bug.

I think you could consider refactoring it like Eric said but I don't believe
this is required.


-- 
Configure bugmail: http://bugzilla.opendarwin.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list