| 1474 | //----------------------------------------------------------------------------- |
| 1475 | |
| 1476 | RectI GuiEditCtrl::getSelectionBounds() const |
| 1477 | { |
| 1478 | Vector<GuiControl *>::const_iterator i = mSelectedControls.begin(); |
| 1479 | |
| 1480 | Point2I minPos = (*i)->localToGlobalCoord( Point2I( 0, 0 ) ); |
| 1481 | Point2I maxPos = minPos; |
| 1482 | |
| 1483 | for(; i != mSelectedControls.end(); i++) |
| 1484 | { |
| 1485 | Point2I iPos = (**i).localToGlobalCoord( Point2I( 0 , 0 ) ); |
| 1486 | |
| 1487 | minPos.x = getMin( iPos.x, minPos.x ); |
| 1488 | minPos.y = getMin( iPos.y, minPos.y ); |
| 1489 | |
| 1490 | Point2I iExt = ( **i ).getExtent(); |
| 1491 | |
| 1492 | iPos.x += iExt.x; |
| 1493 | iPos.y += iExt.y; |
| 1494 | |
| 1495 | maxPos.x = getMax( iPos.x, maxPos.x ); |
| 1496 | maxPos.y = getMax( iPos.y, maxPos.y ); |
| 1497 | } |
| 1498 | |
| 1499 | minPos = getContentControl()->globalToLocalCoord( minPos ); |
| 1500 | maxPos = getContentControl()->globalToLocalCoord( maxPos ); |
| 1501 | |
| 1502 | return RectI( minPos.x, minPos.y, ( maxPos.x - minPos.x ), ( maxPos.y - minPos.y ) ); |
| 1503 | } |
| 1504 | |
| 1505 | //----------------------------------------------------------------------------- |
| 1506 |
nothing calls this directly
no test coverage detected