MCPcopy Create free account
hub / github.com/TankOs/SFGUI / HandleMouseMoveEvent

Method HandleMouseMoveEvent

src/SFGUI/Window.cpp:205–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203}
204
205void Window::HandleMouseMoveEvent( int x, int y ) {
206 if( ( x == std::numeric_limits<int>::min() ) || ( y == std::numeric_limits<int>::min() ) ) {
207 return;
208 }
209
210 if( m_dragging ) {
211 SetPosition(
212 sf::Vector2f(
213 static_cast<float>( x ) - m_drag_offset.x,
214 static_cast<float>( y ) - m_drag_offset.y
215 )
216 );
217 }
218 else if( m_resizing && (GetStyle() & RESIZE) == RESIZE ) {
219 SetAllocation(
220 sf::FloatRect(
221 GetAllocation().position,
222 { std::max( GetRequisition().x, static_cast<float>( x ) + m_drag_offset.x - GetAllocation().position.x ),
223 std::max( GetRequisition().y, static_cast<float>( y ) + m_drag_offset.y - GetAllocation().position.y ) }
224 )
225 );
226 }
227}
228
229bool Window::HandleAdd( Widget::Ptr child ) {
230 if( !Bin::HandleAdd( child ) ) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected