javascript - Methods for most performant dashed rectangle -
i have rectangle, stroke 1px dashed line typical of selection objects see in image editors.
i researching methods, , wondering performant?
- should draw recntangle go through , clear gaps?
- should use
dashedline
here draw 4 dashed lines? https://stackoverflow.com/a/4577326/1828637 - any other methods?
thanks
using context.setlinedash(segments);
valid method supported major browsers.
read more here: https://developer.mozilla.org/en-us/docs/web/api/canvasrenderingcontext2d/setlinedash
Comments
Post a Comment