| 1330 | } |
| 1331 | |
| 1332 | void MidiController::DrawModuleUnclipped() |
| 1333 | { |
| 1334 | if (mHoveredLayoutElement != -1) |
| 1335 | { |
| 1336 | std::string tooltip; |
| 1337 | ofVec2f pos; |
| 1338 | if (mHoveredLayoutElement < kHoveredLayoutElement_GridOffset) |
| 1339 | { |
| 1340 | tooltip = GetLayoutTooltip(mHoveredLayoutElement); |
| 1341 | pos = mLayoutControls[mHoveredLayoutElement].mPosition; |
| 1342 | pos.x += mLayoutControls[mHoveredLayoutElement].mDimensions.x + 3; |
| 1343 | pos.y += mLayoutControls[mHoveredLayoutElement].mDimensions.y / 2; |
| 1344 | } |
| 1345 | else |
| 1346 | { |
| 1347 | tooltip = "grid"; |
| 1348 | auto* grid = mGrids[mHoveredLayoutElement - kHoveredLayoutElement_GridOffset]; |
| 1349 | pos = grid->mPosition; |
| 1350 | pos.x += 18; |
| 1351 | } |
| 1352 | |
| 1353 | float width = GetStringWidth(tooltip); |
| 1354 | |
| 1355 | ofFill(); |
| 1356 | ofSetColor(50, 50, 50); |
| 1357 | ofRect(pos.x, pos.y, width + 10, 15); |
| 1358 | |
| 1359 | ofNoFill(); |
| 1360 | ofSetColor(255, 255, 255); |
| 1361 | ofRect(pos.x, pos.y, width + 10, 15); |
| 1362 | |
| 1363 | ofSetColor(255, 255, 255); |
| 1364 | DrawTextNormal(tooltip, pos.x + 5, pos.y + 12); |
| 1365 | } |
| 1366 | } |
| 1367 | |
| 1368 | std::string MidiController::GetLayoutTooltip(int controlIndex) |
| 1369 | { |
nothing calls this directly
no test coverage detected