MCPcopy Create free account
hub / github.com/DISTRHO/DPF / motionEvent

Function motionEvent

dgl/src/EventHandlers.cpp:106–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104 }
105
106 bool motionEvent(const Widget::MotionEvent& ev)
107 {
108 if (! enabledInput)
109 return false;
110
111 bool ret = false;
112
113 if (widget->contains(ev.pos))
114 {
115 // check if entering hover
116 if ((state & kButtonStateHover) == 0x0)
117 {
118 const int state2 = state;
119 state |= kButtonStateHover;
120 ret = widget->contains(lastMotionPos);
121 self->stateChanged(static_cast<State>(state), static_cast<State>(state2));
122 widget->repaint();
123 }
124 }
125 else
126 {
127 // check if exiting hover
128 if (state & kButtonStateHover)
129 {
130 const int state2 = state;
131 state &= ~kButtonStateHover;
132 ret = widget->contains(lastMotionPos);
133 self->stateChanged(static_cast<State>(state), static_cast<State>(state2));
134 widget->repaint();
135 }
136 }
137
138 lastMotionPos = ev.pos;
139 return ret || button != -1;
140 }
141
142 void setActive(const bool active2, const bool sendCallback) noexcept
143 {

Callers 2

onMotionMethod · 0.85
onMotionMethod · 0.85

Calls 3

containsMethod · 0.45
stateChangedMethod · 0.45
repaintMethod · 0.45

Tested by

no test coverage detected