Path’s strokeEnabled property shows as true on a specific image.
Steps to reproduce
Outline stroke the yellow circle
Code:
node.forEach(function (childNode, i) {
if (childNode.strokeEnabled) {
//do one thing
} else {
//kep the original path
}
});
Expected Behavior
A similar circle (the red one, the smaller one), doesn’t have a border when performing outline stroke - doesn’t error and doesn’t modify the shape.
Actual Behavior
When outlining the yellow (big) circle this will give you the “cannot read property ‘value’ of null”. This is related to creating a new element with the same border colour on scenegraph and the colour missing. The circle does not have a border. Thus, it should not be trying to create objects from that border.
Ok.
Applied on a shape created into XD it returns strokeEnabled property correctly, but if applied on an object imported from Illustrator it first returns true even if it has no border: check then uncheck the Border option in the properties panel will solve.
It’s possible for strokeEnabled to be true but stroke is null (no stroke drawn) or stroke has opacity = 0% (the stroke occupies pixels for hit-testing purposes but is invisible).
@peterflynn I do that anyway, however, it is also possible for the strokeEnabled to be false, and the opacity to be 0 and stroke to be null too, which unfirtunately renders opacity = 1 useless.