Opened 13 years ago

Closed 13 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: konrads@…, eugene.lazutkin@…
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 konrads@…

Change History (3)

comment:1 Changed 13 years ago by Eugene Lazutkin

Looks like a bug --- I will investigate it.

comment:2 Changed 13 years ago by Eugene Lazutkin

Cc: konrads@… eugene.lazutkin@… added

comment:3 Changed 13 years ago by Eugene Lazutkin

Resolution: invalid
Status: newclosed

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.

Note: See TracTickets for help on using tickets.