Jump to content


  • Posts

  • Joined

  • Last visited

Posts posted by Cirox

  1. This is in another way to do it:


    Hi Cirox,
    You can constrain the shape by doing a little math...

    var offset = this.x * Math.tan(45 * Math.PI / 180);
    TweenLite.set(drag, { width: this.x, height: offset });
    TweenLite.set(handle, { top: offset });

    But an even easier approach would be to do it as a ratio. 45 degrees would be 1:1, so just set the height and width equal to each other.
    TweenLite.set(drag, { width: this.x, height: this.x });
    TweenLite.set(handle, { top: this.x });

    CodePen URL: 

    See the Pen emWwzb?editors=001 by osublake (@osublake) on CodePen


    Thanks OSUblake