| 263 | } |
| 264 | |
| 265 | void Minimap::OnClicked(float x, float y, bool right) |
| 266 | { |
| 267 | if (mGrid->TestClick(x, y, right, true)) |
| 268 | { |
| 269 | float gridX, gridY; |
| 270 | mGrid->GetPosition(gridX, gridY, true); |
| 271 | GridCell cell = mGrid->GetGridCellAt(x - gridX, y - gridY); |
| 272 | int number = cell.mCol + cell.mRow + '1'; |
| 273 | if (GetKeyModifiers() == kModifier_Shift) |
| 274 | TheSynth->GetLocationZoomer()->WriteCurrentLocation(number); |
| 275 | else |
| 276 | TheSynth->GetLocationZoomer()->MoveToLocation(number); |
| 277 | } |
| 278 | else |
| 279 | { |
| 280 | ofRectangle boundingBox; |
| 281 | ofRectangle viewport = TheSynth->GetDrawRect(); |
| 282 | ComputeBoundingBox(boundingBox); |
| 283 | ofVec2f viewportCoords = CoordsToViewport(boundingBox, x, y); |
| 284 | TheSynth->SetDrawOffset(ofVec2f(-viewportCoords.x + viewport.width / 2, -viewportCoords.y + viewport.height / 2)); |
| 285 | mClick = true; |
| 286 | } |
| 287 | } |
| 288 | |
| 289 | void Minimap::MouseReleased() |
| 290 | { |
nothing calls this directly
no test coverage detected