| 533 | //----------------------------------------------------------------------------- |
| 534 | |
| 535 | void GuiScrollCtrl::scrollTo(S32 x, S32 y) |
| 536 | { |
| 537 | if( !size() ) |
| 538 | return; |
| 539 | |
| 540 | if ( x == mChildRelPos.x && y == mChildRelPos.y ) |
| 541 | return; |
| 542 | |
| 543 | setUpdate(); |
| 544 | if (x > mChildExt.x - mContentExt.x) |
| 545 | x = mChildExt.x - mContentExt.x; |
| 546 | if (x < 0) |
| 547 | x = 0; |
| 548 | |
| 549 | if (y > mChildExt.y - mContentExt.y) |
| 550 | y = mChildExt.y - mContentExt.y; |
| 551 | if (y < 0) |
| 552 | y = 0; |
| 553 | |
| 554 | Point2I delta(x - mChildRelPos.x, y - mChildRelPos.y); |
| 555 | mChildRelPos += delta; |
| 556 | mChildPos -= delta; |
| 557 | |
| 558 | for(SimSet::iterator i = begin(); i != end();i++) |
| 559 | { |
| 560 | GuiControl *ctrl = (GuiControl *) (*i); |
| 561 | ctrl->setPosition( ctrl->getPosition() - delta ); |
| 562 | } |
| 563 | calcThumbs(); |
| 564 | |
| 565 | onScroll_callback(); |
| 566 | } |
| 567 | |
| 568 | //----------------------------------------------------------------------------- |
| 569 |
no test coverage detected