1. #1
    Sencha User alei.alhepSoft's Avatar
    Join Date
    Aug 2010
    Location
    Cajamarca
    Posts
    35
    Vote Rating
    1
    alei.alhepSoft is on a distinguished road

      0  

    Question MIGRATE DRAWING FROM ExtJs-3 + Raphael TO ExtJs4

    MIGRATE DRAWING FROM ExtJs-3 + Raphael TO ExtJs4


    Hellow!
    I'm migrating my application from ExtJs 3 to ExtJs 4.
    For drawing in my application I was using Raphael, now I want use the API of drawing that comes with ExtJs 4.
    My problem is that I need extend the Ext.draw.Component for draw an especific set of graphic objects so that the components change of size dinamically when the draw component is resized. I implemented the next code:
    Code:
    Ext.define("MyApp.Drawing.CirclePainter",{
        extend:"Ext.draw.Component",
    ....
        afterComponentLayout: function(w,h){
                  var xc=w/3, yc=h/3;
                  radius=Math.min(w,h)/2;
                   this.surface.add({         
                type: 'circle',
                fill: '#ffc',
                radius: 100,
                x: xc,
                y: yc
            });
    ...
        }
    })
    for test this class i use the next code:
    Code:
            Ext.onReady(function(){
                circlePainter= Ext.create("MyApp.Drawing.CirclePainter",{})
                Ext.create('Ext.Window', {
                    width: 640,height: 480,
                    title:"testCirclePainter",
                    layout: 'fit',
                    items: [circlePainter]
                }).show();
    
    
            })
    however, this not works!
    someone know why when I invoque the method add of the surface nothing happens?

    in despite of that, if previously the draw component contains elements,and invoque the method removeAll on the afterComponentLayout overrided method, all the components are removed.

    Is very strange that I can remove elements, but don't create elements dinamically!

  2. #2
    Sencha User alei.alhepSoft's Avatar
    Join Date
    Aug 2010
    Location
    Cajamarca
    Posts
    35
    Vote Rating
    1
    alei.alhepSoft is on a distinguished road

      1  

    Thumbs up I HAVE IT!

    I HAVE IT!


    Alei,
    The component is adding the item but is not redrawing.
    For make redraw do the next:
    Code:
    	sprite = this.surface.add({
    			type: 'circle',
    			fill: '#FF8040',
    			radius: 50,
    			x: 100,
    			y: 100
    		});
    		sprite.setAttributes(null,true)
    the second parameter of setAttributes makes the sprite redraw.

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi