Gradient stops positioning in clipped shape

Bug #1397720 reported by Stefano
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Unassigned

Bug Description

I am using this handcrafted SVG to test:
======
<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<svg version="1.1"
     width="100"
     height="100"
     viewBox="0 0 100 100">

<linearGradient id="grad">
  <stop style="stop-color:#ff0000;" offset="0" />
  <stop style="stop-color:#ffffff;" offset="0.5" />
  <stop style="stop-color:#0000ff;" offset="1" />
</linearGradient>

<clipPath id="cp">
  <path d="M 0,0 50,0 50,50 0,50 z" />
</clipPath>
<rect style="fill: url(#grad);"
      width="100"
      height="100"
      x="0"
      y="0"
      clip-path="url(#cp)" />

</svg>
======

Basically there is a rectangle filled with a gradient that goes from left to right and from red to white to blue. Then I clip it to the left half.

I'd expect to see only the right half transparent, and the left half with a gradient from red to white (no blue). Eog shows it like that.

Inkscape shows the right half transparent (correct), but the gradient in the left part is re-positioned relative to the clipped region, so I see the whole gradient from red to white to blue.

I am not an expert on SVG spec, so it might be as well a problem in the library that eog uses, but eog's behavior seems more natural, so I tried reporting it here first.

I am using inkspace 0.48.5.

Tags: gradient
Revision history for this message
su_v (suv-lp) wrote :

Attaching pasted SVG source as file to ease testing …

tags: added: gradient
Revision history for this message
su_v (suv-lp) wrote :

Attaching fixed version (missing root element namespace declaration).

Revision history for this message
su_v (suv-lp) wrote :

On OS X 10.7.5:
- reproduced with Inkscape 0.48.5
- not reproduced with Inkscape 0.91pre2 r13666
- not reproduced with Inkscape 0.91+devel r13778

Will be fixed in the upcoming release 0.91.

Changed in inkscape:
importance: Undecided → Medium
milestone: none → 0.91
status: New → Fix Committed
Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.