Closed Bug 282026 Opened 20 years ago Closed 19 years ago

SVG linear gradient not rotated

Categories

(Core :: SVG, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: gtrebaol, Assigned: tor)

References

()

Details

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b) Gecko/20050210
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b) Gecko/20050210

When a rotated shape uses a linear gradient,
the gradient should rotate as well

Reproducible: Always

Steps to Reproduce:
1. load the URL

Actual Results:  
The rotated trapeze contains a linear gradient with a vertical axis 

Expected Results:  
The axis of the gradient should be rotated at 120°
Assignee: general → tor
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attachment #174405 - Flags: review?(scootermorris)
Attachment #174405 - Attachment is obsolete: true
Attachment #174405 - Flags: review?(scootermorris)
Attachment #174422 - Flags: review?(scootermorris)
Comment on attachment 174422 [details] [diff] [review]
same + fix a couple trivial radial gradient bugs

Just a couple of nits....

>+
>+  nsCOMPtr<nsIDOMSVGMatrix> bboxTransform;
>+  PRUint16 bbox;
>+  GetGradientUnits(&bbox);
>+  if (bbox == nsIDOMSVGGradientElement::SVG_GRUNITS_OBJECTBOUNDINGBOX) {
>+    nsISVGChildFrame *frame = nsnull;
>+    if (aSource)
>+      CallQueryInterface(aSource, &frame);
>+    nsCOMPtr<nsIDOMSVGRect> rect;
>+    if (frame) {
>+      frame->SetMatrixPropagation(PR_FALSE);
>+      frame->NotifyCanvasTMChanged();
>+      frame->GetBBox(getter_AddRefs(rect));
>+      frame->SetMatrixPropagation(PR_TRUE);
>+      frame->NotifyCanvasTMChanged();
>+    }

Why not just include this if-block inside of the if (frame) block
above?	Then rect could be scoped inside of that block.

>+    if (rect) {
>+      float x, y, width, height;
>+      rect->GetX(&x);
>+      rect->GetY(&y);
>+      rect->GetWidth(&width);
>+      rect->GetHeight(&height);
>+      NS_NewSVGMatrix(getter_AddRefs(bboxTransform),
>+                      width, 0, 0, height, x, y);
>+    }
>+  }

>Index: layout/svg/renderer/src/gdiplus/nsSVGGDIPlusGradient.cpp
>===================================================================

Strange spacing here.  Was that intentional for some reason?

>+    rect[0].X = fX1 + INF * dy;             rect[0].Y = fY1 - INF * dx;
>     rect[1].X = fX1 + INF * dx + INF * dy;  rect[1].Y = fY1 + INF * dy - INF * dx;
>     rect[2].X = fX1 + INF * dx - INF * dy;  rect[2].Y = fY1 + INF * dy + INF * dx;
>-    rect[3].X = fX1 - INF * dy;  rect[3].Y = fY1 + INF * dx;
>+    rect[3].X = fX1 - INF * dy;             rect[3].Y = fY1 + INF * dx;
>     left.AddPolygon(rect, 4);
>     left.Transform(aMatrix);
>+    left.Transform(aCTM);
>     

Same thing here...

>+    rect[1].X = fX2 + INF * dy;             rect[1].Y = fY2 - INF * dx;
>+    rect[2].X = fX2 - INF * dy;             rect[2].Y = fY2 + INF * dx;
>     rect[3].X = fX2 - INF * dx - INF * dy;  rect[3].Y = fY2 - INF * dy + INF * dx;
>     right.AddPolygon(rect, 4);
>     right.Transform(aMatrix);
>+    right.Transform(aCTM);
>
Attachment #174422 - Flags: review?(scootermorris) → review+
Checked in.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: