I have an SVG polygon that I am attempting to animate the stroke for, however I have an issue where I can't get all four corners to appear to be joined together once I start using stroke-dasharray
.
Here is an example:
svg {
overflow: visible;
width: 300px;
}
polygon {
fill: none;
stroke: #E1B87F;
stroke-width: 6px;
}
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 200 200" style="enable-background:new 0 0 200 200;" xml:space="preserve">
<polygon points="100,0 0,100 100,200 200,100" style="stroke-dasharray: 565.685px; stroke-dashoffset: 0px;" />
</svg>
It doesn't really seem to matter how I handle the dash array or the offset, the top corner is always disconnected.
Is this just a pitfall of dealing with SVG, or is there something that can be done to fix it?