X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=0.6.x%2Fjs%2F02_dom%2F10_XNodeAnime.js;h=2d20bad71dc7ea1432eb462cb86620ccaa3950bb;hb=b28fd52ddc41a1c927f92fa7eeeb6891c41e55d9;hp=003b89c60c80f3e443d7fb381cf36d003923b7e4;hpb=3d352d8bf476ab57cc333e8d02d0e6ea5efa69b7;p=pettanr%2FclientJs.git diff --git a/0.6.x/js/02_dom/10_XNodeAnime.js b/0.6.x/js/02_dom/10_XNodeAnime.js index 003b89c..2d20bad 100644 --- a/0.6.x/js/02_dom/10_XNodeAnime.js +++ b/0.6.x/js/02_dom/10_XNodeAnime.js @@ -65,7 +65,7 @@ var X_Node_ANIMATIONS = [], X_Node_Anime_hasTransform = !!X_Node_CSS_VENDER_PREFIX[ 'transform' ], /* Opera mobile で translateZ(0) が有効だと XY が 0 0 になる */ - /* GPUレイヤーにいる間に要素のコンテンツを変更をすると transitionend が動かなくなるっぽい Mac safari と firefox, 手当てが済むまでここは常に false */ + /* GPUレイヤーにいる間に要素のコンテンツを変更をすると transitionend が動かなくなるっぽい Mac safari と firefox */ X_Node_Anime_translateZ = X_Node_CSS_VENDER_PREFIX[ 'perspective' ] && !X_UA[ 'OperaMobile' ] && !X_UA[ 'OperaTablet' ] ? ' translateZ(0)' : '', /* Opera12(XP,8.1) 切った方がスムース, win Safari3 で、たまに動作が止まってしまう、、、 */ X_Node_Anime_hasTransition = !!X_Node_CSS_VENDER_PREFIX[ 'transitionDelay' ] && !X_UA[ 'Opera' ], // && !( X_UA[ 'Webkit' ] <= 528.16 ), @@ -292,9 +292,6 @@ function X_Node_Anime_detectAnimationLayers(){ X_Node_Anime_needsDetection = false; }; -/* TODO - * 0:無, 1:子のGPU解除待 2:GPU予約, 3:GPU now!, 4:GPU解除予約 - */ function X_Node_Anime_updateAnimation( xnode ){ var obj = xnode[ '_anime' ], phase = obj.phase, @@ -344,14 +341,13 @@ function X_Node_Anime_updateAnimation( xnode ){ //console.log( 'duration = 0 の場合、アニメーションの解除' ); // duration = 0 の場合、アニメーションの解除 - case 3 : // アニメーションの解除 + case 3 : // TransitionEnd -> アニメーションの解除 obj.phase = obj.gpuParent ? 10 : 4; console.log( '#### アニメーションの解除 ' + obj.phase ); // このタイミングで animation 関連の css を削除したところ(X_Node_Anime_clearTransition)、iOS3、4 で再描画忘れが度々起きるように、、、 if( !obj.gpuParent ) X_Node_Anime_clearTransition( xnode ); - //xnode[ 'dispatch' ]( { type : X_EVENT_ANIME_END, 'gpu' : obj.gpuParent } ); break; case 4 : @@ -361,7 +357,6 @@ function X_Node_Anime_updateAnimation( xnode ){ case 10 : // アニメーションは停止・GPUレイヤーは解除していない(再アニメーションに備えて待機) - //X_Node_Anime_clearTransition( xnode ); // TODO X_Node_Anime_releaseGPULayer に移動? if( !obj.gpuTimerID ){ console.log( '#### アニメーションは停止 ' + obj.wait ); if( obj.wait ){ @@ -387,7 +382,7 @@ function X_Node_Anime_updateAnimation( xnode ){ X_Node_Anime_clearTransition( xnode ); X_Node_Anime_updatePosition( xnode, obj.destX, obj.destY, obj.destA, phase === 14 ); obj.phase = phase === 14 ? 10 : 4; - xnode[ 'asyncDispatch' ]( time, { type : X_EVENT_ANIME_END, 'gpu' : obj.gpuParent } ); + xnode[ 'dispatch' ]( time, { type : X_EVENT_ANIME_END, 'gpu' : obj.gpuParent } ); } else { current = X_Node_Anime_getComputedPosition( xnode ); obj.startX = current.x; @@ -433,8 +428,8 @@ function X_Node_Anime_getComputedPosition( that ) { x = + ( matrix[ 12 ] || matrix[ 4 ] ); y = + ( matrix[ 13 ] || matrix[ 5 ] ); } else { - x = + parseInt( matrix.left ); - y = + parseInt( matrix.top ); + x = + parseFloat( matrix.left ); + y = + parseFloat( matrix.top ); }; return { x : x, y : y, a : matrix[ X_Node_CSS_Support[ 'opacity' ] ] }; @@ -506,15 +501,15 @@ function X_Node_Anime_updatePosition( xnode, x, y, opacity, useGPU ){ if( X_Node_Anime_hasTransform ){ xnode[ 'css' ]({ transform : 'translate(' + ( x | 0 ) + 'px,' + ( y | 0 ) + 'px)' + ( useGPU ? X_Node_Anime_translateZ : '' ), - opacity : opacity === 1 ? '' : opacity + opacity : opacity }); } else { x === x && xnode[ 'css' ]({ left : ( x | 0 ) + 'px', - opacity : opacity === 1 ? '' : opacity }); + opacity : opacity }); y === y && xnode[ 'css' ]({ top : ( y | 0 ) + 'px', - opacity : opacity === 1 ? '' : opacity }); + opacity : opacity }); }; if( X_Node_Anime_translateZ ){