rebootcode / svg-edit

Automatically exported from code.google.com/p/svg-edit
MIT License
0 stars 0 forks source link

<g> clip-path exception #833

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a document like so:
<svg width="640" height="480" xmlns="http://www.w3.org/2000/svg" 
xmlns:xlink="http://www.w3.org/1999/xlink">
 <defs>
  <clipPath id="clipPath_30">
   <use xlink:href="#rect_30" id="use_30"/>
  </clipPath>
 </defs>
 <g>
  <title>Layer 1</title>
  <g id="svg_30">
   <rect y="83.74802" x="94.86584" width="783.84554" stroke-width="5" stroke="#000000" id="rect_30" height="524.57355" fill="#FFFFFF"/>
   <image y="307.74802" xlink:href="images/logo.png" x="62.86584" width="783.84554" id="img_30" height="524.57355" clip-path="url(#clipPath_30)"/>
  </g>
 </g>
</svg>
2. Try and move the group that has a clip-pathed <image> inside it.
3. On mouseup the result is uncaught exception: [Exception... "Component 
returned failure code: 0x80004005 (NS_ERROR_FAILURE) 
[nsIDOMSVGLocatable.getBBox]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" 
location: "JS frame :: 
http://svg-edit.googlecode.com/svn/trunk/editor/svgutils.js :: groupBBFix :: 
line 450" data: no] and the image now is outside the clip-path. Something 
strange is happening in the updateClipPath() method.

What is the expected output? What do you see instead?
No errors and the <image> clipped correctly by the <rect>. I have commented our 
the call to updateClipPath() and it works as expected. Not sure what 
updateClipPath() is really doing or what scenarios it fixes.

In what browser did you experience this problem? (ALL, Firefox, Opera, etc)
Firefox 5, Chrome 12.0.742.124

In what version of SVG-edit does the problem occur? (Latest trunk, 2.5.1,
etc)
Latest trunk

Please provide any additional information below.

Original issue reported on code.google.com by Medinger...@gmail.com on 21 Jul 2011 at 1:49