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

bugzilla-daemon at opendarwin.org bugzilla-daemon at opendarwin.org
Tue Feb 28 14:22:25 PST 2006


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





------- Comment #5 from macdome at opendarwin.org  2006-02-28 14:22 PDT -------
(From update of attachment 6779)
 namespace WebCore {
+using namespace WebCore;

That seems unecessary.

Why not just pass 0?

+    int x = 0, y = 0;
+    if (!shouldPaint(paintInfo, x, y))

Effectively the same code for:
+                case SVG_PRESERVEASPECTRATIO_XMIDYMIN:
+                case SVG_PRESERVEASPECTRATIO_XMIDYMID:
+                case SVG_PRESERVEASPECTRATIO_XMIDYMAX:
+                    srcRect.setX(image()->width() / 2 - srcRect.width() / 2);
+                    break;


is repeated 4 times... Could we perhaps use a function there?

int newLength = calcAlignedLength(int, int, align)
srcRect.setX(newLength)

I think it's best to talk about this over IRC or at least get mjs to review it,
given that he's looked at it once.


-- 
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