1. #1
    Sencha Premium Member Neilcoder's Avatar
    Join Date
    Apr 2011
    Location
    Ireland
    Posts
    262
    Vote Rating
    0
    Neilcoder is on a distinguished road

      0  

    Question surface.add() not working in my code after surface.removeAll()

    surface.add() not working in my code after surface.removeAll()


    I need some help being able to draw after using remove all, I'm trying to add sprites and after using remove all it doesn't show up up on the Svg.... any ideas would be very welcome....

    Here's a truncated version of my code..


    Code:
      var paper = Ext.create('Ext.draw.Component', {
            width: 1000,
            height: 900,
            autoShow: true,
            items: [{
                type: 'path',
                path: ['M0,109.718c0-43.13,24.815-80.463,60.955-98.499L82.914,0C68.122,7.85,58.046,23.406,58.046,41.316',
                'c0,9.64,2.916,18.597,7.915,26.039c-7.44,18.621-11.77,37.728-13.228,56.742c-9.408,4.755-20.023,7.423-31.203,7.424',
                'c-1.074,0-2.151-0.025-3.235-0.075c-5.778-0.263-11.359-1.229-16.665-2.804L0,109.718z M157.473,285.498c0-0.015,0-0.031,0-0.047'].join(''),
                fill: '#C5D83E'
            }],
            renderTo: 'canvas'
    
        });
    
    
    
    function reDraw(){
    
    
                   paper.surface.removeAll();
    
                    paper.surface.add({
                        type: 'path',
                        path: ['M0,109.718c0-43.13,24.815-80.463,60.955-98.499L82.914,0C68.122,7.85,58.046,23.406,58.046,41.316',
                        'c0,9.64,2.916,18.597,7.915,26.039c-7.44,18.621-11.77,37.728-13.228,56.742c-9.408,4.755-20.023,7.423-31.203,7.424',
                        'c-1.074,0-2.151-0.025-3.235-0.075c-5.778-0.263-11.359-1.229-16.665-2.804L0,109.718z M157.473,285.498c0-0.015,0-0.031,0-0.047'].join(''),
                        fill: '#C5D83E'
                    });
    
    }
    Thanks
    Neil

  2. #2
    Sencha Premium Member Neilcoder's Avatar
    Join Date
    Apr 2011
    Location
    Ireland
    Posts
    262
    Vote Rating
    0
    Neilcoder is on a distinguished road

      0  

    Default


    ah joy! found the solution right here;

    http://www.sencha.com/forum/showthre...s-to-a-Surface

Tags for this Thread