       top: vector.y + @_state.elPosition.top
 
     ###
-    bounds = @_state.bounds
+    bounds = @_state.positionBounds
     if pos.left < bounds.ox
       pos.left = bounds.ox
     else if pos.left > bounds.x

  # pattern corresponding to each cardinal
  # pattern: [left,top,width,height]
  coefs:
    n:  [0, 1,  0, -1]
    s:  [0, 0,  0,  1]
    e:  [0, 0,  1,  0]
    w:  [1, 0, -1,  0]
    nw: [1, 1, -1, -1]
    ne: [0, 1,  1, -1]
    se: [0, 0,  1,  1]
    sw: [1, 0, -1,  1]

  resize: (event)=>
    bounds = @_state.bounds
    coef = @_state.coef
    vector =
      x: event.pageX - @_state.origin.x
      y: event.pageY - @_state.origin.y

    #console.log("pointer vector norm")
    #console.log(V.norm(vector))

    localVector =
      x: vector.x * Math.cos(@beta) + vector.y * Math.sin(@beta)
      y: -vector.x * Math.sin(@beta) + vector.y * Math.cos(@beta)

    #console.log("local vector norm")
    #console.log(V.norm(localVector))

    #console.log(V.norm(vector) - V.norm(localVector) < 0.00001)
    #console.log("i",V.signedDir(localVector, 'x'))
    #console.log("j",V.signedDir(localVector, 'y'))

    console.log(localVector)

    style =
      left :  coef[0] * localVector.x + @_state.elPosition.left
      top :   coef[1] * localVector.y + @_state.elPosition.top
      width:  coef[2] * localVector.x + @_state.elDimension.width
      height: coef[3] * localVector.y + @_state.elDimension.height

    @$el.css(style)
    @trigger 'change:resize', style

    mN =
      x : cN.x - cM.x
      y : cN.y - cM.y

    # preparing and changing css
    @$el.css
