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?

  1. should draw recntangle go through , clear gaps?
  2. should use dashedline here draw 4 dashed lines? https://stackoverflow.com/a/4577326/1828637
  3. 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

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -