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

Method UpdatePosition

Source/QuickSpawnMenu.cpp:379–396  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377}
378
379void QuickSpawnMenu::UpdatePosition()
380{
381 float minX = 5;
382 float maxX = ofGetWidth() / GetOwningContainer()->GetDrawScale() - mWidth - 5;
383 float minY = TheTitleBar->GetRect().height + 5;
384 float maxY = ofGetHeight() / GetOwningContainer()->GetDrawScale() - mHeight - 5;
385
386 if (mMenuMode == MenuMode::SingleLetter)
387 {
388 SetPosition(ofClamp(mAppearAtMousePos.x - mWidth / 2, minX, maxX),
389 ofClamp(mAppearAtMousePos.y - mHeight / 2, minY, maxY) + mScrollOffset);
390 }
391 else
392 {
393 SetPosition(ofClamp(mAppearAtMousePos.x - 5, minX, maxX),
394 mAppearAtMousePos.y - kItemSpacing / 2 + mScrollOffset);
395 }
396}
397
398void QuickSpawnMenu::MouseReleased()
399{

Callers 4

DrawModuleMethod · 0.45
DrawMethod · 0.45
RenderMethod · 0.45
DrawPatchCablesMethod · 0.45

Calls 5

ofGetWidthFunction · 0.85
ofGetHeightFunction · 0.85
ofClampFunction · 0.85
GetDrawScaleMethod · 0.80
GetRectMethod · 0.45

Tested by

no test coverage detected