title: Openlaszlo scaling issue in resizestate
body: <p>I am actually trying to create a highlighter when dragging i was able to achieve this using the resize state and drawview class. But this is not working when the view is scaled. </p>
  
  <p>When i am trying to drag the mouse sometimes its working and sometimes the selected region is either getting diminished or getting enlarged. I have attached the sample code</p>
  
  <pre><code>&lt;canvas width="1024" height="768" debug="true"&gt;    
  &lt;class name="boxdraw"&gt;    
  
          &lt;handler name="onmousedown"&gt;&lt;![CDATA[
                  Debug.write("onmousedown");
                  this.boxview.setAttribute ('x', this.getMouse ('x'));
                  this.boxview.setAttribute ('y', this.getMouse ('y'));
                  this.boxview.setAttribute ('width', 0);
                  this.boxview.setAttribute ('height', 0);
                  this.boxview.setAttribute ('visible', true);
  
                  this.boxview.resizer.apply ();
          ]]&gt;&lt;/handler&gt;
  
          &lt;handler name="onmouseup"&gt;&lt;![CDATA[
                  Debug.write("onmouseip");
                  this.boxview.setAttribute ('visible', false);
                  this.boxview.resizer.remove ();
  
          ]]&gt;&lt;/handler&gt;
  
  
          &lt;handler name="oninit" &gt;
                this.setAttribute ('clickable', true);
          &lt;/handler&gt;
      &lt;drawview name="boxview" visible="false"&gt;
               &lt;attribute name="isready" value="false" type="boolean" /&gt;
                &lt;handler name="oncontext"&gt;
                  this.setAttribute("isready", true);
                  this.strokeStyle = 0x999999;
                  this.lineWidth = 2;
                &lt;/handler&gt;
  
              &lt;handler name="oninit"&gt;
                  this.strokeStyle = 0x999999;
                  this.lineWidth = 2;
              &lt;/handler&gt;
  
              &lt;resizestate name="resizer"&gt;
  
                  &lt;attribute name="minheight" value="${-this.y + 1}"/&gt;
                  &lt;attribute name="minwidth" value="${-this.x + 1}"/&gt;
  
                  &lt;attribute name="maxheight" value="${classroot.height - this.y - 1}"/&gt;
                  &lt;attribute name="maxwidth" value="${classroot.width - this.x - 1}"/&gt;
                  &lt;attribute name="xroffset" value="${this.x - this.width + this.getMouse( 'x' )}" /&gt; 
                  &lt;attribute name="yroffset" value="${this.y - this.height + this.getMouse( 'y' )}" /&gt; 
  
  
                  &lt;attribute name="width"
                             value="${(this.immediateparent.getMouse ( 'x' ) - this.xroffset) &gt; this.maxwidth ? 
                                    this.maxwidth : 
                                    Math.max((this.immediateparent.getMouse( 'x' )- this.xroffset), this.minwidth)}" /&gt;
  
                  &lt;attribute name="height"
                             value="${(this.immediateparent.getMouse ( 'y' ) - this.yroffset) &gt; this.maxheight ? 
                                    this.maxheight : 
                                    Math.max((this.immediateparent.getMouse( 'y' )- this.yroffset), this.minheight)}" /&gt;
  
  
                  &lt;handler name="onwidth"&gt;
                      this._draw ();                    
                  &lt;/handler&gt;
  
                  &lt;handler name="onheight"&gt;
                      this._draw ();
  
                  &lt;/handler&gt;
  
  
                  &lt;method name="_draw"&gt;&lt;![CDATA[
                      Debug.write("__draw", this.minheight, this.maxheight,this.minwidth,this.maxwidth);
                      Debug.write("this.xroffset,this.yroffset", this.xroffset,this.yroffset);
                      Debug.write("this.immediateparent.getMouse ( 'x' )",this.immediateparent.getMouse ( 'x' ),this.immediateparent.getMouse ( 'y' ));
  
                      this.clear ();
                      this.beginPath();
                      this.lineTo (this.width, 0);
                      this.lineTo (this.width, this.height);
                      this.lineTo (0, this.height);                                   
                      this.lineTo (0, 0);
                      this.closePath();
                      this.stroke ();
  
                  ]]&gt;&lt;/method&gt;
  
              &lt;/resizestate&gt;
          &lt;/drawview&gt;
  
  
  
      &lt;/class&gt;
  
      &lt;view name="sample" width="1024" height="600" bgcolor="green" xscale="1.63" yscale="1.53"&gt;
          &lt;boxdraw name="resizebox" 
                             width="100%" height="100%"
                            options="ignorelayout" 
                             visible="true"/&gt;
      &lt;/view&gt;
  
  &lt;/canvas&gt;
  </code></pre>