Flash / Actionscript line thickness will draw lines outside co-ordinates given in lineTo -


this basic question ran when drawing as. let's have following code.

g.linestyle(20, 0xff0000, 1, false); g.moveto(10, 10); g.lineto(210, 10);    

because line thickness 20. draw line rectangle (0,0) (220, 20). i.e. thickness/2 added in each dimension.

i wanted know if: 1. correct or got wrong? 2. every time need draw line don't want bound within e.g. drawing inside border need take account line not go outside particular area. correct?

yes, 1) correct. regards 2) getrect() method not take stroke width in account. here code:

stop();  var mc:movieclip = new movieclip();  var gr:graphics = mc.graphics;   //draw rectangle 50x50 gr.linestyle(20); gr.beginfill(0, 0.5); gr.drawrect(0, 0, 50, 50); gr.endfill();  this.addchild(mc);  //will trace (x=0, y=0, w=50, h=50) trace(mc.getrect(this));  //will trace (x=-10, y=-10, w=70, h=70) trace(mc.getbounds(this)); 

Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -