1. #1
    Sencha Premium Member
    Join Date
    Oct 2011
    Location
    Duluth, MN
    Posts
    126
    Vote Rating
    4
    Answers
    2
    badgerb1 is on a distinguished road

      0  

    Default Unanswered: isPointInPath doesn't work most of the time.

    Unanswered: isPointInPath doesn't work most of the time.


    It appears that isPointInPath doesn't work with circles or other paths many times for some reason.

    Try this in the live preview pane on the circle documentation.

    Code:
    var x = new Ext.draw.Component({
      fullscreen: true,
      items: []
    });
    var y = x.getSurface().add({
        type: 'circle',
        cx: 100,
        cy: 100,
        r: 25,
        fillStyle: 'blue'
      });
      x.element.on('mousemove', function(e){
          if (y.attr.path.isPointInPath(e.pageX, e.pageY)){
            console.log(e);
         console.log(y.attr.path.isPointInPath(e.pageX, e.pageY));
          }
        
    });
    x.renderFrame();
    you'll see that no matter where you put the cursor, isPointInPath is never true.

    Changing to

    Code:
    var x = new Ext.draw.Component({  fullscreen: true,
      items: []
    });
    var y = x.getSurface().add(
    {
        type: 'path',
        path: 'M75,75 c0,-25 50,25 50,0 c0,-25 -50,25 -50,0',
        fillStyle: 'blue'
      });
      x.element.on('mousemove', function(e){
          if (y.attr.path.isPointInPath(e.pageX, e.pageY)){
            console.log(e);
         console.log(y.attr.path.isPointInPath(e.pageX, e.pageY));
          }
        
    });
    x.renderFrame();
    Throws this error:
    Uncaught TypeError: Object function (w){return((s*w+r)*w+p)*w+o} has no method 'cubicRoot'

    I actually also get this error when using a circle too in my program, I can't recreate that error with a circle here though.

    Any Ideas?

    Thanks
    Bob

  2. #2
    Sencha User
    Join Date
    Jan 2013
    Posts
    1
    Vote Rating
    0
    vstoyak is on a distinguished road

      0  

    Default Was it resolved

    Was it resolved


    I have the same issue of isPointInPath being inaccurate and generating

    Uncaught TypeError: Object function (t) {
    return ((a * t + b) * t + c) * t + d;
    } has no method 'cubicRoot'


    Were you able to make it work?

Thread Participants: 1