MCPcopy Create free account
hub / github.com/SpartanJ/eepp / onMouseDown

Method onMouseDown

src/eepp/ui/uislider.cpp:134–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132}
133
134Uint32 UISlider::onMouseDown( const Vector2i& position, const Uint32& flags ) {
135 if ( !getEventDispatcher()->isNodeDragging() ) {
136 Vector2f mouseDownInitPos( getEventDispatcher()->getMouseDownPos().asFloat() );
137 worldToNode( mouseDownInitPos );
138 if ( getLocalDpBounds().contains( mouseDownInitPos ) ) {
139 Vector2f localPos( position.asFloat() );
140 worldToNode( localPos );
141 if ( localPos.y >= mSlider->getPosition().y &&
142 localPos.y <= mSlider->getPosition().y + mSlider->getSize().getHeight() ) {
143 mSlider->startDragging( position.asFloat() );
144 }
145 }
146 }
147 return UIWidget::onMouseDown( position, flags );
148}
149
150void UISlider::adjustChildren() {
151 mUpdating = true;

Callers

nothing calls this directly

Calls 8

isNodeDraggingMethod · 0.80
getMouseDownPosMethod · 0.80
startDraggingMethod · 0.80
asFloatMethod · 0.45
containsMethod · 0.45
getPositionMethod · 0.45
getHeightMethod · 0.45
getSizeMethod · 0.45

Tested by

no test coverage detected