チェンジセット 1624

差分発生行の前後
無視リスト:
コミット日時:
2008/10/15 17:40:06 (3 年前)
コミッタ:
gyuque
ログメッセージ:

0.4.13: apply _width, _height props / implemented Mouse.hide/show

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • ruby/jsplash/trunk/client2/demo_20081001.xml

    r1619 r1624  
    5656                <p id="statusout"> </p> 
    5757                <p>playing on javascript with JSplash</p> 
    58                 <p id="sout">starting <em>JSplash Player 0.4.12</em>...<br />-------------------------------------<br /></p> 
     58                <p id="sout">starting <em>JSplash Player 0.4.13</em>...<br />-------------------------------------<br /></p> 
    5959                <svg id="svgrt" xmlns="http://www.w3.org/2000/svg" style="width: 100px; height: 100px;"> 
    6060                </svg> 
  • ruby/jsplash/trunk/client2/esanta.xml

    r1622 r1624  
    7070                <div id="progbar"><div>  </div></div> 
    7171                <p id="statusout"> </p> 
    72                 <p id="sout"><em>JSplash Player</em> 0.4.12<br /></p> 
     72                <p id="sout"><em>JSplash Player</em> 0.4.13<br /></p> 
    7373                <svg id="svgrt" xmlns="http://www.w3.org/2000/svg" style="width: 100px; height: 100px;"> 
    7474                </svg> 
  • ruby/jsplash/trunk/client2/esanta/movie1.js

    r1622 r1624  
    11JSplash.load_swf( { 
    2  header: {frameRate: 20, frames: 1, width: 12800, height: 9600}, 
     2 header: {frameRate: 20, frames: 1, width: 9600, height: 10800}, 
    33 exports: {'mc_dot':4,'mc_line':1,'__Packages.Spring':63,'__Packages.Node':65,'__Packages.Muscle':64}, 
    44 taglist: [ 
  • ruby/jsplash/trunk/client2/index.xml

    r1619 r1624  
    5454                <div id="progbar"><div>  </div></div> 
    5555                <p id="statusout"> </p> 
    56                 <p id="sout"><em>JSplash Player</em> 0.4.12<br />-------------------------------------<br /></p> 
     56                <p id="sout"><em>JSplash Player</em> 0.4.13<br />-------------------------------------<br /></p> 
    5757                <svg id="svgrt" xmlns="http://www.w3.org/2000/svg" style="width: 100px; height: 100px;"> 
    5858                </svg> 
  • ruby/jsplash/trunk/client2/jsplash/objects.js

    r1619 r1624  
    4848                this.dynamic = false; 
    4949                this.dynDepthBase = null; 
     50                this.bboxCache = {w:null, h:null}; 
    5051 
    5152                this.mousePos = {x:0, y:0}; 
     
    193194                 
    194195        }, 
     196 
     197        invalidateBBox: function() { 
     198                for (o = this;;o = o.parent) { 
     199                        o.bboxCache.w = null; 
     200                        if (o.is_stage) break; 
     201                } 
     202        }, 
    195203         
    196204        placeObject: function(depth, oid, iname, clip_depth, replace_flg, inherit_transform, inherit_color_transform) { 
    197205                this.clipMap[depth] = clip_depth || this.clipMap[depth]; 
     206                this.invalidateBBox(); 
    198207 
    199208                if (this.context.reachedFrame > this.context.frameC) { 
     
    202211                        if (this.depthMap[depth] != po) 
    203212                        { 
    204 if (this.depthMap[depth] && this.depthMap[depth].klass.classId == 4) console.log(depth); 
    205213                                this.removeObject(depth); 
    206214                        } 
     
    352360 
    353361        removeObject: function(depth, to_replace) { 
     362                this.invalidateBBox(); 
    354363                var o = this.pickPlacedObjectAt(depth); 
    355364 
     
    749758                var T = this.pxTransform; 
    750759                 
     760                this.checkSizeChange(P); 
    751761                if (P._x != T.mx || P._y != T.my || 
    752762                        P._xscale != T.sx || P._yscale != T.sy || 
     
    809819                if (JSplash._bbox_implemented) { 
    810820                        try { 
    811                                 var b = this.g.getBBox(); 
    812                                 P._width  = b.width; 
    813                                 P._height = b.height; 
     821                                if (this.bboxCache.w == null) 
     822                                { 
     823                                        var bx = this.g.getBBox(); 
     824                                        this.bboxCache.w = bx.width; 
     825                                        this.bboxCache.h = bx.height; 
     826                                } 
     827 
     828                                var b = this.bboxCache; 
     829                                P._width  = b.w; 
     830                                P._height = b.h; 
    814831                        } catch(e) { 
    815832                                console.warn("This browser does not support SVG bounding box completely."); 
     833                                JSplash._bbox_implemented = false; 
     834                        } 
     835                } 
     836        }, 
     837 
     838        checkSizeChange: function(P) { 
     839                if (JSplash._bbox_implemented) { 
     840                        try { 
     841 
     842                                var T = this.pxTransform; 
     843 
     844                                if (this.bboxCache.w == null) 
     845                                { 
     846                                        var bx = this.g.getBBox(); 
     847                                        this.bboxCache.w = bx.width; 
     848                                        this.bboxCache.h = bx.height; 
     849                                } 
     850 
     851                                var b = this.bboxCache; 
     852 
     853                                var d, o; 
     854 
     855                                d = P._width - b.w; 
     856                                if (d<-0.01 || d > 0.01) { 
     857                                        o = b.w; 
     858                                        if (o < -.1 || o > .1) 
     859                                                P._xscale = (P._width / o) * 100.0; 
     860                                } 
     861 
     862                                d = P._height - b.h; 
     863                                if (d<-0.01 || d > 0.01) { 
     864                                        o = b.h; 
     865                                        if (o < -.1 || o > .1) 
     866                                                P._yscale = (P._height / o) * 100.0; 
     867                                } 
     868 
     869                        } catch(e) { 
     870                                console.warn("This browser does not support SVG bounding box completely: "+e); 
    816871                                JSplash._bbox_implemented = false; 
    817872                        } 
  • ruby/jsplash/trunk/client2/jsplash/player.js

    r1619 r1624  
    1919                this.executor.frameRate = swf.frameRate; 
    2020                this.svg = svg; 
     21                this.bodyElement = document.getElementsByTagName("body")[0]; 
    2122                JSplash.createFillDef(svg); 
    2223 
     
    3940                svg.addEventListener("mousemove", this.onTopMouseMove.bind(this, svg), false); 
    4041                svg.addEventListener("mousedown", this.onTopMouseDown.bind(this), false); 
    41                 document.getElementsByTagName("body")[0].addEventListener("mouseup", this.onGlobalMouseUp.bind(this), false); 
     42                this.bodyElement.addEventListener("mouseup", this.onGlobalMouseUp.bind(this), false); 
    4243 
    4344                JSplash.SWFGlobals.setup(this); 
    4445                this.preprocessShapes(0); 
     46        }, 
     47 
     48        hideCursor: function() { 
     49                Element.addClassName(this.bodyElement, "jsplash-hide-cursor"); 
     50        }, 
     51 
     52        showCursor: function() { 
     53                Element.removeClassName(this.bodyElement, "jsplash-hide-cursor"); 
    4554        }, 
    4655 
     
    157166        document.styleSheets[0].insertRule(":active>.jsplash-btn-down{visibility:visible;}", 0); 
    158167         
     168        document.styleSheets[0].insertRule(".jsplash-hide-cursor .jsplash-hitarea, .jsplash-hide-cursor{cursor:url('./jsplash/null.gif'), default;}", 0); 
    159169        document.styleSheets[0].insertRule(".jsplash-hitarea{opacity:0; cursor:pointer;}", 0); 
    160170 
  • ruby/jsplash/trunk/client2/jsplash/swfglobal.js

    r1619 r1624  
    3333JSplash.SWFGlobals.Mouse = { 
    3434        hide: function() { 
     35                JSplash.gPlayer.hideCursor(); 
    3536        }, 
    3637 
    3738        show: function() { 
     39                JSplash.gPlayer.showCursor(); 
    3840        } 
    3941} 
  • ruby/jsplash/trunk/client2/rocket_demo.xml

    r1619 r1624  
    5656                <p id="statusout"> </p> 
    5757                <p>playing on javascript with JSplash</p> 
    58                 <p id="sout">starting <em>JSplash Player 0.4.12</em>...<br />-------------------------------------<br /></p> 
     58                <p id="sout">starting <em>JSplash Player 0.4.13</em>...<br />-------------------------------------<br /></p> 
    5959                <svg id="svgrt" xmlns="http://www.w3.org/2000/svg" style="width: 100px; height: 100px;"> 
    6060                </svg>