Flash / Actionscript线条粗细将绘制lineTo中给出的坐标外的线条(Flash / Actionscript line thickness will draw lines outside co-ordinates given in lineTo)
这是我在使用AS绘图时遇到的一个非常基本的问题。 假设我有以下代码。
g.lineStyle(20, 0xff0000, 1, false); g.moveTo(10, 10); g.lineTo(210, 10);
因为线条粗细为20.这实际上会将线条绘制为从(0,0)到(220,20)的矩形。 即每个尺寸都会加上厚度/ 2。
我想知道:1。这是正确的还是我弄错了? 因此,每当我们需要绘制线条而我们不希望它被束缚在某些东西中时,例如绘制内部边界,我们需要考虑到这一点,因此线条不会超出特定区域。 这也是正确的吗?
This is a very basic question I ran into when drawing with AS. Let's say I have the following code.
g.lineStyle(20, 0xff0000, 1, false); g.moveTo(10, 10); g.lineTo(210, 10);
Because the line thickness is 20. This will actually draw a line as a rectangle from (0,0) to (220, 20). i.e. thickness/2 will get added in each dimension.
I wanted to know if: 1. This is correct or I got it wrong? 2. So every time we need to draw line where we don't want it to be bound within something e.g. drawing an inside border we need to take this into account so the line would not go outside a particular an area. Is that also correct?
原文:https://stackoverflow.com/questions/22522444