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

Method onMouseUp

src/eepp/ui/uicodeeditor.cpp:1810–1863  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1808}
1809
1810Uint32 UICodeEditor::onMouseUp( const Vector2i& position, const Uint32& flags ) {
1811 mLastActivity.restart();
1812 for ( auto& plugin : mPlugins )
1813 if ( plugin->onMouseUp( this, position, flags ) )
1814 return UIWidget::onMouseUp( position, flags );
1815
1816 if ( NULL == mFont )
1817 return UIWidget::onMouseUp( position, flags );
1818
1819 bool minimapHover =
1820 mMinimapEnabled && getMinimapRect( getScreenStart() ).contains( position.asFloat() );
1821
1822 Input* input = getInput();
1823
1824 MouseBindings::Shortcut shortcut{ MouseAction::Up, flags, getInput()->getSanitizedModState() };
1825
1826 if ( flags & EE_BUTTON_LMASK ) {
1827 stopMinimapDragging( position.asFloat() );
1828 if ( mMouseDown ) {
1829 mMouseDown = false;
1830 mMouseDownMinimap = false;
1831 input->captureMouse( false );
1832 }
1833
1834 tryExecuteMouseBinding( shortcut );
1835 } else if ( flags & EE_BUTTON_WDMASK ) {
1836 if ( getInput()->isKeyModPressed() ) {
1837 mDoc->execute( "font-size-shrink" );
1838 } else if ( input->isModState( KEYMOD_SHIFT ) ) {
1839 setScrollX( mScroll.x + mMouseWheelScroll );
1840 } else {
1841 setScrollY( mScroll.y + mMouseWheelScroll );
1842 }
1843 } else if ( flags & EE_BUTTON_WUMASK ) {
1844 if ( getInput()->isKeyModPressed() ) {
1845 mDoc->execute( "font-size-grow" );
1846 } else if ( input->isModState( KEYMOD_SHIFT ) ) {
1847 setScrollX( mScroll.x - mMouseWheelScroll );
1848 } else {
1849 setScrollY( mScroll.y - mMouseWheelScroll );
1850 }
1851 } else if ( flags & EE_BUTTON_WRMASK ) {
1852 setScrollX( mScroll.x + mMouseWheelScroll );
1853 } else if ( flags & EE_BUTTON_WLMASK ) {
1854 setScrollX( mScroll.x - mMouseWheelScroll );
1855 } else if ( !minimapHover && ( flags & EE_BUTTON_RMASK ) ) {
1856 Vector2f localPos( convertToNodeSpace( position.asFloat() ) );
1857 if ( localPos.x >= mPaddingPx.Left + getGutterWidth() && localPos.y >= mPluginsTopSpace )
1858 onCreateContextMenu( position, flags );
1859 } else if ( tryExecuteMouseBinding( shortcut ) )
1860 return UIWidget::onMouseUp( position, flags );
1861
1862 return UIWidget::onMouseUp( position, flags );
1863}
1864
1865Uint32 UICodeEditor::onMouseClick( const Vector2i& position, const Uint32& flags ) {
1866 mLastActivity.restart();

Callers

nothing calls this directly

Calls 8

getSanitizedModStateMethod · 0.80
captureMouseMethod · 0.80
isKeyModPressedMethod · 0.80
isModStateMethod · 0.80
restartMethod · 0.45
containsMethod · 0.45
asFloatMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected