Frage

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?

War es hilfreich?

Lösung

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?

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top