# Resize box as mouse moves

**URL:** <https://forum.kirupa.com/t/resize-box-as-mouse-moves/317404>\
**Category:** Uncategorized\
**Created:** [December 19, 2010, 9:23am UTC](https://forum.kirupa.com/t/resize-box-as-mouse-moves/317404 "2010-12-19T09:23:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Geki](https://avatars.discourse-cdn.com/v4/letter/g/cab0a1/32.png) [@Geki](https://forum.kirupa.com/u/Geki)\
**Post date:** [December 19, 2010, 9:23am UTC](https://forum.kirupa.com/t/resize-box-as-mouse-moves/317404/1 "2010-12-19T09:23:36Z")

</div>

Hey,

I’m making a quite basic selection box thing. You mouse down somewhere and then drag a box around an area.

Redrawing the rectangle on every mouse move update is quite heavy so I’m trying to set the height and width of an already drawn sprite.

But, I get a problem when I try to set the height and width of a rectangle that **has boarders**.  
When I’m resizing a normal vector rectangle then everything happens as you would expect. But when I add the boarder _box.graphics.lineStyle(1, 0xFF0000, 1, true, “none”);_ everything goes wrong. The box does resize but it goes way slower then my mouse.

Example: When my mouse is at 200x200 the box has a size of 100x100 and so on.

Is there something I’m missing? Or could it possibly be, that flash is scaling the boarder as it should, then making it a hairline again, but the width of the already scaled boarder still stays?
