Fix double click selection on locked documents.

Fix UITextEdit multi-line rendering + Fix DocumentView::isLineVisible.
Fix AutoClose brackets being applied even when was not enabled (ex. UITextInput).
This commit is contained in:
Martín Lucas Golini
2024-08-13 01:32:52 -03:00
parent 1576fa7eb1
commit 01b393e848
4 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -401,7 +401,7 @@ double DocumentView::getLineYOffset( Int64 docIdx, Float lineHeight ) const {
}
bool DocumentView::isLineVisible( Int64 docIdx ) const {
return mDocLineToVisibleIndex.empty() ||
return mDocLineToVisibleIndex.empty() || isOneToOne() ||
( docIdx < static_cast<Int64>( mDocLineToVisibleIndex.size() ) &&
mDocLineToVisibleIndex[docIdx] != static_cast<Int64>( VisibleIndex::invalid ) );
}
+1 -1
View File
@@ -1645,7 +1645,7 @@ void TextDocument::textInput( const String& text, bool mightBeInteresting ) {
BoolScopedOp op( mDoingTextInput, true );
BoolScopedOp op2( mInsertingText, true );
if ( 1 == text.size() ) {
if ( 1 == text.size() && mAutoCloseBrackets ) {
auto inserted = autoCloseBrackets( text );
if ( !inserted.empty() ) {
+2 -2
View File
@@ -1585,7 +1585,7 @@ Uint32 UICodeEditor::onMouseDoubleClick( const Vector2i& position, const Uint32&
if ( plugin->onMouseDoubleClick( this, position, flags ) )
return UIWidget::onMouseDoubleClick( position, flags );
if ( mLocked || NULL == mFont )
if ( NULL == mFont )
return 1;
if ( mMinimapEnabled ) {
@@ -1594,7 +1594,7 @@ Uint32 UICodeEditor::onMouseDoubleClick( const Vector2i& position, const Uint32&
return 1;
}
if ( flags & EE_BUTTON_LMASK ) {
if ( isTextSelectionEnabled() && ( flags & EE_BUTTON_LMASK ) ) {
mDoc->selectWord( false );
mLastDoubleClick.restart();
checkColorPickerAction();
+1 -1
View File
@@ -51,7 +51,7 @@ Uint32 UITextEdit::getType() const {
}
bool UITextEdit::isType( const Uint32& type ) const {
return UITextEdit::getType() == type ? true : UIWidget::isType( type );
return UITextEdit::getType() == type ? true : UICodeEditor::isType( type );
}
void UITextEdit::setTheme( UITheme* Theme ) {