Hello All
how to get value from enums? i’m trying to use svg library and get Path segments.
svg objects are organised inside this lib as enum:
enum DisplayElement {
DisplayPath(path:Path);
DisplayGroup(group:Group);
DisplayText(text:Text);
}
and i need to get that Path instance. i ended u with following code:
var p:Path = switch(testSvg.findGroup("layer1").children[0]) {
case DisplayGroup(group):
case DisplayPath(path): path;
case DisplayText(text):
}
for(segment in p.segments){
trace(segment);
}
it works, but it looks to complicated to use switch if i know exactly what to expect.
may be there is another way to get Path instance from this Enum?