MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / onMotion

Function onMotion

src/CardinalUI.cpp:1023–1036  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1021 }
1022
1023 bool onMotion(const MotionEvent& ev) override
1024 {
1025 #ifdef DPF_RUNTIME_TESTING
1026 if (inSelfTest) return false;
1027 #endif
1028
1029 const rack::math::Vec mousePos = rack::math::Vec(ev.pos.getX(), ev.pos.getY()).div(getScaleFactor()).round();
1030 const rack::math::Vec mouseDelta = mousePos.minus(lastMousePos);
1031
1032 lastMousePos = mousePos;
1033
1034 const ScopedContext sc(this, glfwMods(ev.mod));
1035 return context->event->handleHover(mousePos, mouseDelta);
1036 }
1037
1038 bool onScroll(const ScrollEvent& ev) override
1039 {

Callers

nothing calls this directly

Calls 5

VecClass · 0.85
roundMethod · 0.80
divMethod · 0.80
minusMethod · 0.80
glfwModsFunction · 0.70

Tested by

no test coverage detected