Question

I have got this:

 1| var seglist = path.pathSegList, list = [], 
 2|     x, y, ix, iy, item, nItem;
 3|
 4| for (var i = 0, n = seglist.numberOfItems; i < n; i++) {
 5|   item = seglist.getItem(i);
 6|   if (item instanceof SVGPathSegMovetoAbs) {
 7|    .
 8|   }
 9|   .
10|   .
11| }

and line 6 throws this error:

Unhandled Error: Undefined variable: SVGPathSegMovetoAbs

why?

Était-ce utile?

La solution

Not all SVG DOM interfaces were fully exposed in Opera(Presto).

item instanceof SVGPathSeg

returns true however. If you want to check what type of segment you get, why not use the pathSegType or pathSegTypeAsLetter attributes on SVGPathSeg instead?

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top