# Linestyle & beginfill going wacko!

**URL:** <https://forum.kirupa.com/t/linestyle-beginfill-going-wacko/280964>\
**Category:** Uncategorized\
**Created:** [February 3, 2009, 2:53pm UTC](https://forum.kirupa.com/t/linestyle-beginfill-going-wacko/280964 "2009-02-03T14:53:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ayman](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@Ayman](https://forum.kirupa.com/u/Ayman)\
**Post date:** [February 3, 2009, 2:53pm UTC](https://forum.kirupa.com/t/linestyle-beginfill-going-wacko/280964/1 "2009-02-03T14:53:52Z")

</div>

When you use linestyle and beginfill to create a stroked rectangle:

```auto
   shape.graphics.lineStyle(thickness, borderColor, 0.4, false, LineScaleMode.NORMAL,CapsStyle.NONE, JointStyle.MITER, 10);
   shape.graphics.beginFill(0xff0000,0.5);
   shape.graphics.moveTo(0,0);
   shape.graphics.lineTo(0,h);
   shape.graphics.lineTo(w,h);
   shape.graphics.lineTo(w,0);
   shape.graphics.lineTo(0,0);
   shape.graphics.endFill();

```

… and change the thickness, it gives a rectangle of different widths. The stroke is very carelessly rendered (based on the thickness). I basically want the stroke to appear as an inner stroke, and no matter what stroke thickness is used, the overall width should look the same. Any ideas guys?
