Opened 14 years ago
Closed 14 years ago
#2355 closed defect (invalid)
stroke join type "round" requires setTransform before the rounded corners manifest.
Reported by: | guest | Owned by: | Eugene Lazutkin |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | gfx (svg+vml) | Version: | 0.4.1 |
Keywords: | gfx, stroke, setTransform, round | Cc: | [email protected]…, [email protected]… |
Blocked By: | Blocking: |
Description
Stroke join type "round" requires setTransform before the rounded corners manifest. Sample code here:
dojo.require("dojo.gfx.*"); dojo.require("dojo.html.layout"); dojo.require("dojo.html.style"); var color = "#ffffcc"; container = dojo.byId("bubble"); var surface = dojo.gfx.createSurface(container, 350, 250); var my_rect=surface.createRect({x: 0, y:0, width:250, height:150}); my_rect.setFill(color); my_rect.setStroke({color: color, width: 10, join: "round" }); // The next line if enabled shows the corners, if not - does not my_rect.setTransform({ dx: 10, dy: 10 });
Furthermore, the dx, dy have to be >= stroke width. Is this a bug or mis-documentation?
Konrads [email protected]…
Change History (3)
comment:1 Changed 14 years ago by
comment:2 Changed 14 years ago by
Cc: | [email protected]… [email protected]… added |
---|
comment:3 Changed 14 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Actually it is not a bug. Theoretically a stroke style doesn't change the geometry, in the Real LifeTM it does, if it is thick enough. It looks like a half of thick stroke is physically outside of rectangle, so if your rectangle is clipped on surface's boundaries (it does), it will cut off 3 of 4 corners. The right-bottom corner is not clipped, so you can see it rounded. By moving your rectangle you move it out of clipping boundaries. Just change the stroke color to something different and you will see the effect of clipping. This behavior consistent in SVG and VML.
Looks like a bug --- I will investigate it.