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

Method DrawModuleUnclipped

Source/Snapshots.cpp:233–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231}
232
233void Snapshots::DrawModuleUnclipped()
234{
235 if (mDisplayMode == DisplayMode::Grid)
236 {
237 int hover = mGrid->CurrentHover();
238 if (hover >= 0 && hover < mSnapshotCollection.size())
239 {
240 std::string tooltip = mSnapshotCollection[hover].mLabel;
241 ofVec2f pos = mGrid->GetCellPosition(hover % mGrid->GetCols(), hover / mGrid->GetCols()) + mGrid->GetPosition(true);
242 pos.x += (mGrid->GetWidth() / mGrid->GetCols()) + 3;
243 pos.y += (mGrid->GetHeight() / mGrid->GetRows()) / 2;
244
245 float width = GetStringWidth(tooltip);
246
247 ofFill();
248 ofSetColor(50, 50, 50);
249 ofRect(pos.x, pos.y, width + 10, 15);
250
251 ofNoFill();
252 ofSetColor(255, 255, 255);
253 ofRect(pos.x, pos.y, width + 10, 15);
254
255 ofSetColor(255, 255, 255);
256 DrawTextNormal(tooltip, pos.x + 5, pos.y + 12);
257 }
258 }
259}
260
261bool Snapshots::HasSnapshot(int index) const
262{

Callers

nothing calls this directly

Calls 14

GetStringWidthFunction · 0.85
ofFillFunction · 0.85
ofSetColorFunction · 0.85
ofRectFunction · 0.85
ofNoFillFunction · 0.85
DrawTextNormalFunction · 0.85
CurrentHoverMethod · 0.80
sizeMethod · 0.80
GetCellPositionMethod · 0.45
GetColsMethod · 0.45
GetPositionMethod · 0.45
GetWidthMethod · 0.45

Tested by

no test coverage detected