1

I want to use GWT Canvas to draw a dashed border around a canvas element like Rectangle. I like the style that the css attribute border: dashed produces, especially the way the corners are displayed, like seen here: https://developer.mozilla.org/en-US/docs/CSS/border-style

Can the "source" code of how this dashed line is produces be inspected somewhere?

membersound
  • 81,582
  • 193
  • 585
  • 1,120
  • Try downloading the source for Firefox: https://developer.mozilla.org/en-US/docs/Developer_Guide/Source_Code/Downloading_Source_Archives I don't know what language it is, but the answer is probably in there somewhere... :) – jgthms Feb 08 '13 at 12:52
  • There is no way you can block a client-side code, the best you can do is minify/uglify. – Toping Feb 08 '13 at 12:52

2 Answers2

-1

Found this function in the Firefox source: nsCSSRenderingBorders. I don't understand the code, but the answer probably lies in there.

http://mxr.mozilla.org/mozilla-central/source/layout/base/nsCSSRenderingBorders.cpp

jgthms
  • 864
  • 8
  • 18
  • OK thats probably more complicated than I thought. Anyhow it's what I was looking for, I don't see why this answer got a downvote. – membersound Feb 08 '13 at 13:19
-1

If you want that styling for your borders :

element.style {
  background-color: palegreen;
  border-style: dashed;
}

or

element.style {
  border-style: 2px dashed #000;
}

Is this what you want ?

If you want a java function to do so, or some place to start to 'study' go here gwtcanvasdemo. and there is a link to the sources. Also, another post on SO related to the subject dotted stroke in canvas and then, there is /DashedLineRenderer.java

Community
  • 1
  • 1
Milche Patern
  • 19,632
  • 6
  • 35
  • 52
  • No I'm aware of this. I'm just looking for a java function to draw dashed line around eg a Rectangle (to draw on GWT Canvas as mentioned). – membersound Feb 08 '13 at 13:32