Zero-length dashes and caps

VectorPaint dotted strokes: zero-length dashes and round caps

Compare round and butt caps on matching SVG paths and observe zero-length dashes and gaps.

English translation of the Chinese original, translated on . Original publication dates, attribution, code and version notes are retained.

Compare round and butt caps on matching SVG paths and observe zero-length dashes and gaps.

Define the comparison

The W3C SVG stroking specification illustrates dotted strokes made with zero-length dashes and round caps. Compare the same 0 20 dash array using round and butt caps: zero is the dash length and 20 the following gap, not a count of dots. Establish a browser reference before observing VectorPaint import and output; a specification example does not guarantee attribute preservation by an app version.

Set up the lines and canvas

Create a UTF-8 SVG in a plain-text editor, with the SVG namespace and viewBox 0 0 240 120 on the root. Add two lines from x1=20 to x2=220 at y=35 and y=85. Give both the same dark-blue stroke, stroke-width 8 and stroke-dasharray 0 20. Set the first line’s stroke-linecap to round and the second to butt. Set a convenient display width and height on the root, save as zero-dash-caps.svg, copy a backup and check its extension.

Predict dot size and spacing

Along the 200-user-unit centerline the cycle is 0 plus 20, or 20 user units. A round cap at a zero-length dash makes a circular mark whose diameter is determined by stroke width 8. Adjacent centers are about 20 units apart; that is not the empty edge-to-edge distance. A butt cap on a zero-length segment does not make the corresponding circular area. Inspect actual endpoint truncation and rendering rather than assuming all browsers show exactly the same endpoint count.

Establish a browser reference

Open the original in an SVG-capable browser and observe whether the upper row forms dots while the lower row lacks the same circular marks. Ensure enough contrast with the background so an invisible zero-length butt dash is not mistaken for a failed file. Zoom the whole page to compare center spacing; zoom affects pixels but does not make 20 user units equal 20 physical millimeters. If the upper row is solid, inspect array and cap spelling and CSS overrides.

Separate center spacing from empty space

For equal 8-unit dots with centers 20 units apart, both inside the line and not clipped at endpoints, visible edge-to-edge space is approximately 20 minus 8, or 12 user units. This applies to equal circles on the same straight line; clipping or transforms require another assessment. On paper mark centers at x=20 and x=40 and extend radius 4 on both sides to check edges. Do not call the gap-array value 20 the visible empty edge-to-edge distance.

Change width as one control

Save a copy and change stroke-width from 8 to 12 for both lines, leaving array and coordinates unchanged. The dot diameter should increase while centers retain a 20-unit cycle; the interior edge-to-edge space becomes about 8. Endpoint and edge observations still require checking clipping. Do not alter only the upper width and attribute every difference to caps. Record the changed property in each copy before comparing browser results.

Change spacing separately

Save a different copy from the original and change both arrays to 0 30 while retaining width 8. The center cycle is now 30, with about 22 user units of visible space between interior dots; dot size should not increase merely because spacing changed. Name this file separately from the width-change copy to avoid changing two factors at once. If the number of dots changes, consider line length and cycle together instead of treating the second array item as a dot count.

Open a copy in the app

In the VectorPaint gallery, tap the square-and-down-arrow import icon at the top right (accessibility label “Import Artwork”), or “Import from Files” in an empty gallery, and select the exercise SVG working copy in the system file picker. If the interface differs, the entry is unavailable, or the file cannot be read, record the step as incomplete. Do not assume stroke-linecap is an app button. Before editing, compare upper dot size and spacing and the lower appearance, then try selecting the lines separately. Record differences from the browser; matching appearance does not prove the zero-length array is retained unchanged.

Troubleshoot style and display

If both rows become dotted in the app, first check whether import converted caps, whether a shared style overrides them and whether the correct copy was opened; do not immediately declare a defect. If only some dots vanish, check viewBox clipping, zoom, opacity and export bounds. Browser and app may use different renderers. Record versions, filename and visible results, leaving untested conditions unknown.

Perform two output checks

Save the editable original and use a share or export entry actually shown in the current version to save separately without overwriting the SVG backup. Reopen and inspect dot shape, spacing and endpoint crop. For SVG output, use a text editor to inspect whether lines, arrays and caps remain or were converted to another representation. A matching screenshot alone does not prove editable attributes; bitmap comparison covers appearance only. Record expectation, browser, app and reopened result, marking unperformed device steps pending.

Compare an all-zero array

Save another original copy and change both arrays to 0 0. The SVG specification treats an array of all zero values as none, so the expected result is a continuous undashed stroke. This differs from 0 20, which contains a nonzero gap. Keep line, color and width unchanged and label the copy. A continuous line is not evidence of infinitely overlapping round dots; this is the specification’s special handling of an all-zero array.

Record the experiment scope

List array, width, cap, browser version and observed result for each file. Record the two rows first rather than extrapolating one browser result to every device. Mark files not actually opened in the app as pending.

Stroke-cap comparison; Dash-array repetition.

Checked 23 November 2026: Apple public version lookup; W3C: SVG stroking. No physical-device or private-server test is claimed.