MCPcopy Create free account
hub / github.com/VCVRack/Rack / onButton

Method onButton

src/ui/ScrollWidget.cpp:114–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112
113
114void ScrollWidget::onButton(const ButtonEvent& e) {
115 math::Rect offsetBound = getContainerOffsetBound();
116 // Check if scrollable
117 if (offsetBound.size.x > 0.f || offsetBound.size.y > 0.f) {
118 // Handle Alt-click before children, since most widgets consume Alt-click without needing to.
119 if (e.button == GLFW_MOUSE_BUTTON_LEFT && (e.mods & RACK_MOD_MASK) == GLFW_MOD_ALT) {
120 e.consume(this);
121 return;
122 }
123 // Might as well handle middle click before children as well.
124 if (e.button == GLFW_MOUSE_BUTTON_MIDDLE) {
125 e.consume(this);
126 return;
127 }
128 }
129
130 Widget::onButton(e);
131}
132
133
134void ScrollWidget::onDragStart(const DragStartEvent& e) {

Callers

nothing calls this directly

Calls 1

consumeMethod · 0.80

Tested by

no test coverage detected