<resizestate>
A standard resize behavior.

JavaScript: lz.resizestate
extends <state> » <node> » lz.Eventable »

resizestate can be used to change the width and height of a view in response to the movement of the mouse.

In the example below, the resizestate tracks differences in the mouse position from after it is applied, so the bottom right corner of the resizing view does not snap to the mouse position.

Example 95. Resizing a view using the mouse

<canvas height="120">
              <view bgcolor="green" width="100" height="100" onmousedown="rs.setAttribute('applied', true)" onmouseup="rs.setAttribute('applied', false)">
                <resizestate name="rs"/>
              </view>
            </canvas>
edit

resizes its immediateparent in response to mouse events, when applied

Attributes

Name Type (tag) Type (js) Default Category
height expression any this.immediateparent.getMouse( 'y' )- this.__resize_yroffset read/write
   
__resize_xroffset expression any this.x - this.width + this.getMouse( 'x' ) read/write
  the x offset from the mouse
__resize_yroffset expression any this.y - this.height + this.getMouse( 'y' ) read/write
  the y offset from the mouse
width expression any this.immediateparent.getMouse( 'x' )- this.__resize_xroffset read/write
   

Attributes inherited from <state>

applied, pooling

Methods

Methods inherited from <state>

apply, remove

Methods inherited from lz.Eventable

destroy, setAttribute

Events

Events inherited from <state>

onapplied, onapply, onremove

Events inherited from <node>

onconstruct, ondata, oninit

Events inherited from lz.Eventable

ondestroy