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

Method TestClick

Source/IClickable.cpp:48–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48bool IClickable::TestClick(float x, float y, bool right, bool testOnly /* = false */)
49{
50 if (!mShowing)
51 return false;
52
53 float w, h;
54 GetDimensions(w, h);
55
56 float titleBarHeight = 0;
57 IDrawableModule* module = dynamic_cast<IDrawableModule*>(this);
58 if (module && module->HasTitleBar())
59 titleBarHeight = IDrawableModule::TitleBarHeight();
60
61 if (x >= mX && y >= mY - titleBarHeight && x <= mX + w && y <= mY + h)
62 {
63 if (!testOnly)
64 OnClicked(x - mX, y - mY, right);
65 return true;
66 }
67 return false;
68}
69
70bool IClickable::NotifyMouseMoved(float x, float y)
71{

Callers 15

OnClickedMethod · 0.45
OnClickedMethod · 0.45
OnClickedMethod · 0.45
OnClickedMethod · 0.45
OnClickedMethod · 0.45
OnClickedMethod · 0.45
OnClickedMethod · 0.45
OnClickedMethod · 0.45
GetModuleAtMethod · 0.45
OnClickedMethod · 0.45
OnClickedMethod · 0.45
MousePressedMethod · 0.45

Calls 1

HasTitleBarMethod · 0.45

Tested by

no test coverage detected