| 377 | } |
| 378 | |
| 379 | void QuickSpawnMenu::UpdatePosition() |
| 380 | { |
| 381 | float minX = 5; |
| 382 | float maxX = ofGetWidth() / GetOwningContainer()->GetDrawScale() - mWidth - 5; |
| 383 | float minY = TheTitleBar->GetRect().height + 5; |
| 384 | float maxY = ofGetHeight() / GetOwningContainer()->GetDrawScale() - mHeight - 5; |
| 385 | |
| 386 | if (mMenuMode == MenuMode::SingleLetter) |
| 387 | { |
| 388 | SetPosition(ofClamp(mAppearAtMousePos.x - mWidth / 2, minX, maxX), |
| 389 | ofClamp(mAppearAtMousePos.y - mHeight / 2, minY, maxY) + mScrollOffset); |
| 390 | } |
| 391 | else |
| 392 | { |
| 393 | SetPosition(ofClamp(mAppearAtMousePos.x - 5, minX, maxX), |
| 394 | mAppearAtMousePos.y - kItemSpacing / 2 + mScrollOffset); |
| 395 | } |
| 396 | } |
| 397 | |
| 398 | void QuickSpawnMenu::MouseReleased() |
| 399 | { |
no test coverage detected