| 198 | //----------------------------------------------------------------------------- |
| 199 | |
| 200 | void GuiAutoScrollCtrl::_reset( GuiControl* control ) |
| 201 | { |
| 202 | U32 axis = _getScrollAxis(); |
| 203 | U32 counterAxis = ( axis == 1 ? 0 : 1 ); |
| 204 | |
| 205 | Point2I newPosition( mChildBorder, mChildBorder ); |
| 206 | Point2I newExtent = control->getExtent(); |
| 207 | |
| 208 | // Fit control on axis that is not scrolled. |
| 209 | newExtent[ counterAxis ] = getExtent()[ counterAxis ] - mChildBorder * 2; |
| 210 | |
| 211 | // For the right and down scrolls, position the control away from the |
| 212 | // right/bottom edge of our control. |
| 213 | |
| 214 | if( mDirection == Right ) |
| 215 | newPosition.x = - ( newExtent.x - getExtent().x + mChildBorder ); |
| 216 | else if( mDirection == Down ) |
| 217 | newPosition.y = - ( newExtent.y - getExtent().y + mChildBorder ); |
| 218 | |
| 219 | // Set the child geometry. |
| 220 | |
| 221 | control->setPosition( newPosition ); |
| 222 | control->setExtent( newExtent ); |
| 223 | |
| 224 | // Reset counters. |
| 225 | |
| 226 | mCurrentTime = 0.0f; |
| 227 | mCurrentPhase = PhaseInitial; |
| 228 | mCurrentPosition = control->getPosition()[ axis ]; |
| 229 | } |
| 230 | |
| 231 | //----------------------------------------------------------------------------- |
| 232 |
nothing calls this directly
no test coverage detected