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

Method ForcePosition

Source/Minimap.cpp:321–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

319}
320
321void Minimap::ForcePosition()
322{
323 float width, height, scale;
324 scale = 1 / TheSynth->GetUIScale();
325 GetDimensions(width, height);
326 const int margin = static_cast<int>(UserPrefs.minimap_margin.Get());
327 switch (UserPrefs.minimap_corner.GetIndex())
328 {
329 default:
330 case static_cast<int>(MinimapCorner::TopRight):
331 mX = floor((ofGetWidth() * scale) - (width + margin));
332 mY = margin + TheTitleBar->GetRect().height;
333 break;
334 case static_cast<int>(MinimapCorner::TopLeft):
335 mX = margin;
336 mY = margin + TheTitleBar->GetRect().height;
337 break;
338 case static_cast<int>(MinimapCorner::BottomRight):
339 mX = floor((ofGetWidth() * scale) - (width + margin));
340 mY = floor((ofGetHeight() * scale) - (height + margin));
341 break;
342 case static_cast<int>(MinimapCorner::BottomLeft):
343 mX = margin;
344 mY = floor((ofGetHeight() * scale) - (height + margin));
345 break;
346 }
347}

Callers

nothing calls this directly

Calls 5

ofGetWidthFunction · 0.85
ofGetHeightFunction · 0.85
GetUIScaleMethod · 0.80
GetMethod · 0.80
GetRectMethod · 0.45

Tested by

no test coverage detected