X_UI_rootData[ 'listenOnce' ]( X.UI.Event.LAYOUT_COMPLETE, this, X_UI_ScrollBox_onLayoutComplete );\r
};\r
},\r
- \r
- scrollBy : function( x, y, opt_time, opt_easing ){\r
- this.scrollTo( this.scrollX + x, this.scrollY + y, opt_time, opt_easing );\r
- },\r
\r
scrollTo : function( x, y, opt_time, opt_easing, opt_release ){\r
//if( this.scrollX === x && this.scrollY === y ) return;\r
// scroll の停止、GPU の解除\r
var font = this.fontSize = this._containerXNode.call( 'fontSize' );\r
\r
- this.maxScrollX = ( this.boxWidth - this._containerNode.boxWidth ) * font;\r
- this.maxScrollY = ( this.boxHeight - this._containerNode.boxHeight ) * font;\r
+ this.maxScrollX = ( this.boxWidth - this._containerNode.boxWidth ) * font | 0;\r
+ this.maxScrollY = ( this.boxHeight - this._containerNode.boxHeight ) * font | 0;\r
\r
this.hasHScroll = this.scrollXEnabled && this.maxScrollX < 0;\r
this.hasVScroll = this.scrollYEnabled && this.maxScrollY < 0;\r
easing = '',\r
newX, newY,\r
momentumX, momentumY,\r
- duration, distanceX, distanceY, font;\r
+ duration, distanceX, distanceY;\r
\r
this[ 'unlisten' ]( X.UI.Event._POINTER_MOVE, this, X_UI_ScrollBox_onMove );\r
this[ 'unlisten' ]( [ X.UI.Event._POINTER_UP, X.UI.Event._POINTER_CANCEL ], this, X_UI_ScrollBox_onEnd );\r
// we scrolled less than 10 pixels\r
if( !this.moved ){\r
// this[ 'dispatch' ]( X_EVENT_CANCELED );\r
+ console.log( 'we scrolled less than 10 pixels' );\r
return ret;\r
};\r
\r
// start momentum animation if needed\r
if( this.momentumEnabled && duration < 300 ){\r
- font = this.fontSize;\r
momentumX = this.hasHScroll ?\r
- X_UI_ScrollBox_momentum( this.scrollX, this.startX, duration, this.maxScrollX, this.bounceEnabled ? this.boxWidth * font : 0, this.deceleration ) :\r
+ X_UI_ScrollBox_momentum( this.scrollX, this.startX, duration, this.maxScrollX, this.bounceEnabled ? this.boxWidth * this.fontSize : 0, this.deceleration ) :\r
{ destination: newX, duration: 0 };\r
momentumY = this.hasVScroll ?\r
- X_UI_ScrollBox_momentum( this.scrollY, this.startY, duration, this.maxScrollY, this.bounceEnabled ? this.boxHeight * font : 0, this.deceleration ) :\r
+ X_UI_ScrollBox_momentum( this.scrollY, this.startY, duration, this.maxScrollY, this.bounceEnabled ? this.boxHeight * this.fontSize : 0, this.deceleration ) :\r
{ destination: newY, duration: 0 };\r
newX = momentumX.destination;\r
newY = momentumY.destination;\r
time = Math.max( momentumX.duration, momentumY.duration ) | 0;\r
this.isInTransition = true;\r
} else {\r
- //console.log( '慣性無し' );\r
+ console.log( '慣性無し' );\r
};\r
\r
if( newX != this.scrollX || newY != this.scrollY ){\r
easing = 'quadratic';\r
};\r
\r
- //console.log( 'end2 x:' + newX + ' y:' + newY + ' t:' + time );\r
+ console.log( 'end2 x:' + newX + ' y:' + newY + ' t:' + time );\r
this.scrollTo( newX, newY, time, easing, 1000 );\r
return ret;\r
};\r
\r
- //console.log( 'end1 x:' + newX + ' y:' + newY );\r
+ console.log( 'end1 x:' + newX + ' y:' + newY );\r
this.scrollTo( newX, newY, 0, '', 1000 ); // ensures that the last position is rounded\r
\r
this[ 'dispatch' ]( X.UI.Event.SCROLL_END );\r
};\r
\r
if( x === that.scrollX && y === that.scrollY ){\r
- //console.log( 'no バウンド y:' + y + ' max:' + that.maxScrollY );\r
+ console.log( 'no バウンド y:' + y + ' max:' + that.maxScrollY );\r
return false;\r
};\r
\r
if( e.target !== this._containerXNode || !this.isInTransition ){\r
return X_Callback_NONE;\r
};\r
- //this.xnodeScroller.stop();\r
if( !X_UI_ScrollBox_resetPosition( this, this.bounceTime ) ){\r
this.isInTransition = false;\r
this.dispatch( X.UI.Event.SCROLL_END );\r