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

Method DrawModule

Source/Minimap.cpp:192–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192void Minimap::DrawModule()
193{
194 float width;
195 float height;
196 ofRectangle boundingBox;
197 ofRectangle viewport = TheSynth->GetDrawRect();
198 ForcePosition();
199 ComputeBoundingBox(boundingBox);
200 GetDimensions(width, height);
201
202 DrawModulesOnMinimap(boundingBox);
203
204 for (int i = 0; i < mGrid->GetCols() * mGrid->GetRows(); ++i)
205 {
206 float val = 0.0f;
207 if (TheSynth->GetLocationZoomer()->HasLocation(i + '1'))
208 val = .5f;
209 mGrid->SetVal(i % mGrid->GetCols(), i / mGrid->GetCols(), val);
210 }
211
212 if (width < height)
213 {
214 mGrid->SetDimensions(kBookmarkSize, height);
215 mGrid->SetPosition(width - kBookmarkSize, 0);
216 mGrid->SetGrid(1, kNumBookmarks);
217 }
218 else
219 {
220 mGrid->SetDimensions(width, kBookmarkSize);
221 mGrid->SetPosition(0, height - kBookmarkSize);
222 mGrid->SetGrid(kNumBookmarks, 1);
223 }
224
225 ofPushMatrix();
226 float widthMM;
227 float heightMM;
228 GetDimensionsMinimap(widthMM, heightMM);
229 ofClipWindow(0, 0, widthMM, heightMM, true);
230 ofPushStyle();
231 ofSetColor(255, 255, 255, 80);
232 ofRect(CoordsToMinimap(boundingBox, viewport));
233 ofSetColor(255, 255, 255, 10);
234 ofFill();
235 ofRect(CoordsToMinimap(boundingBox, viewport));
236 ofPopStyle();
237 ofPopMatrix();
238
239 mGrid->Draw();
240
241 if (mHoveredBookmarkPos.mCol != -1)
242 {
243 ofPushStyle();
244 ofSetColor(255, 255, 255);
245 ofFill();
246
247 ofVec2f pos = mGrid->GetCellPosition(mHoveredBookmarkPos.mCol, mHoveredBookmarkPos.mRow) + mGrid->GetPosition(true);
248 float xsize = float(mGrid->GetWidth()) / mGrid->GetCols();
249 float ysize = float(mGrid->GetHeight()) / mGrid->GetRows();

Callers

nothing calls this directly

Calls 15

ofPushMatrixFunction · 0.85
ofClipWindowFunction · 0.85
ofPushStyleFunction · 0.85
ofSetColorFunction · 0.85
ofRectFunction · 0.85
ofFillFunction · 0.85
ofPopStyleFunction · 0.85
ofPopMatrixFunction · 0.85
GetKeyModifiersFunction · 0.85
ofCircleFunction · 0.85
HasLocationMethod · 0.80
GetLocationZoomerMethod · 0.80

Tested by

no test coverage detected