Closed pjh00 closed 9 years ago
Hi pjh00. Can you show the code for this?
My guess, is that this is a side effect of strokes not knowing if they are closed or not. A workaround for this problem would be to draw another line facing right. So:
a ---- b
| |
d ---- c
a->b->c->d->a->b
It's not ideal. The Stroke implementation could be changed to detect closures in the future.
The reason here is the thickness: the thickness is only applied to the width of a stroke, not the length of it. This is from Graphics drawRect:
moveTo( x, y ); lineTo( x + width, y ); lineTo( x + width, y + height ); lineTo( x, y + height ); lineTo( x, y );
The last line could be:
lineTo( x, y - _strokeThickness / 2 );
To make this work, but it might cause other issues.
lonSwitz Thank you. Solved.
I have fixed this now, with the solution mentioned above. I can't believe that this change would cause any problems
var _oShape:Shape = new Shape(); addChild(_oShape); _oShape.graphics.clear(); _oShape.graphics.lineStyle(5, 0xFFFFFF); _oShape.graphics.drawRect(0, 0, 300, 300);