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?

Was it helpful?

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?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top