Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    2
    Vote Rating
    0
    xbrowne is on a distinguished road

      0  

    Default Unanswered: Dynamically Adding to Path Extremely Slow

    Unanswered: Dynamically Adding to Path Extremely Slow


    I've been playing around with freehand drawing using the new DrawComponent and I have it working, however, when drawing a long complex path or adding a lot of sprites to the surface the rendering becomes extremely slow, especially on mobile devices. When it slows down the paths no longer look smooth.

    I suspect it has to do with the surface re-rendering all of the sprites (or path entries) every time a mousemove event is fired.. any ideas? Is there a way to only draw the most recent addition to the path or only redraw the last sprite that was added to the surface?

    I tried redraw(), but so far the only way I can get the paths to display is by calling surface.renderFrame() after every mousemove event. Thanks in advance..

    Code:
    startPath: function(e) {
        
        this.currentPath = this.surface.add({
            type: 'path',
            stroke: 'black',
            'stroke-width': 5,
            path: []
        });
    
        this.addPathEntry('M', e.pageX, e.pageY);
    },
    
    
    addToPath: function(e) {
        
        this.addPathEntry('L', e.pageX, e.pageY);
        this.refresh();
    },
    
    
    addPathEntry: function(command, x, y) {
        
        this.currentPath.path.push(command + x + ',' + y);
    },
    
    
    refresh: function() {
        this.surface.renderFrame();
    }

  2. #2
    Sencha User
    Join Date
    Nov 2011
    Posts
    14
    Vote Rating
    0
    rayman1900 is on a distinguished road

      0  

    Default


    Hi, I'm with the same problem here. Did you found any solution about this ?

  3. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    2
    Vote Rating
    0
    xbrowne is on a distinguished road

      0  

    Default


    Nope, still slow.

Thread Participants: 1

Tags for this Thread