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

Method onMotion

tests/Demo.cpp:189–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187 }
188
189 bool onMotion(const MotionEvent& ev) override
190 {
191 if (contains(ev.pos))
192 {
193 const int iconSize = bgIcon.getWidth();
194
195 for (int i=0; i<kPageCount; ++i)
196 {
197 bgIcon.setY(i*iconSize + i*3);
198
199 if (bgIcon.contains(ev.pos))
200 {
201 if (curHover == i)
202 return true;
203
204 curHover = i;
205 repaint();
206 return true;
207 }
208 }
209
210 if (curHover == -1)
211 return true;
212
213 curHover = -1;
214 repaint();
215 return true;
216 }
217 else
218 {
219 if (curHover == -1)
220 return false;
221
222 curHover = -1;
223 repaint();
224 return true;
225 }
226 }
227
228 void onResize(const ResizeEvent& ev) override
229 {

Callers

nothing calls this directly

Calls 5

containsFunction · 0.85
setYMethod · 0.80
repaintFunction · 0.50
getWidthMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected