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

Method MouseMoved

Source/Minimap.cpp:294–319  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292}
293
294bool Minimap::MouseMoved(float x, float y)
295{
296 if (mClick)
297 {
298 ofRectangle boundingBox;
299 ofRectangle viewport = TheSynth->GetDrawRect();
300 ComputeBoundingBox(boundingBox);
301 ofVec2f viewportCoords = CoordsToViewport(boundingBox, x, y);
302 TheSynth->SetDrawOffset(ofVec2f(-viewportCoords.x + viewport.width / 2, -viewportCoords.y + viewport.height / 2));
303 }
304 mGrid->NotifyMouseMoved(x, y);
305
306 float gridX, gridY;
307 mGrid->GetPosition(gridX, gridY, true);
308 if (mGrid->TestHover(x - gridX, y - gridY))
309 {
310 mHoveredBookmarkPos = mGrid->GetGridCellAt(x - gridX, y - gridY);
311 }
312 else
313 {
314 mHoveredBookmarkPos.mCol = -1;
315 mHoveredBookmarkPos.mRow = -1;
316 }
317
318 return false;
319}
320
321void Minimap::ForcePosition()
322{

Callers

nothing calls this directly

Calls 6

ofVec2fClass · 0.85
NotifyMouseMovedMethod · 0.80
SetDrawOffsetMethod · 0.45
GetPositionMethod · 0.45
TestHoverMethod · 0.45
GetGridCellAtMethod · 0.45

Tested by

no test coverage detected