MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / DrawModuleUnclipped

Method DrawModuleUnclipped

Source/MidiController.cpp:1332–1366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1330}
1331
1332void 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
1368std::string MidiController::GetLayoutTooltip(int controlIndex)
1369{

Callers

nothing calls this directly

Calls 6

GetStringWidthFunction · 0.85
ofFillFunction · 0.85
ofSetColorFunction · 0.85
ofRectFunction · 0.85
ofNoFillFunction · 0.85
DrawTextNormalFunction · 0.85

Tested by

no test coverage detected