mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-05 17:57:14 +00:00
GRAPHICS: MACGUI: change the behavior of cursor and selectedText, currently, we won't draw the cursor when we have selectedText
This commit is contained in:
parent
0176107051
commit
b11dfdfeaa
@ -1049,7 +1049,8 @@ bool MacText::draw(bool forceRedraw) {
|
||||
_composeSurface->frameRect(borderRect, 0);
|
||||
}
|
||||
|
||||
if (_cursorState)
|
||||
// if we are drawing the selection text, then we don't draw the cursor
|
||||
if (_cursorState && !(_selectedText.endY != -1 && _active))
|
||||
_composeSurface->blitFrom(*_cursorSurface, *_cursorRect, Common::Point(_cursorX, _cursorY + offset.y + 1));
|
||||
|
||||
if (_selectedText.endY != -1 && _active)
|
||||
@ -1106,6 +1107,13 @@ void MacText::drawSelection() {
|
||||
if (_selectedText.endY == -1)
|
||||
return;
|
||||
|
||||
// we check if the selection size is 0, then we don't draw it anymore
|
||||
// it's a small optimize, but can bring us correct behavior
|
||||
if (_selectedText.startX == _selectedText.endX && _selectedText.startY == _selectedText.endY) {
|
||||
_selectedText.startY = _selectedText.endY = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
SelectedText s = _selectedText;
|
||||
|
||||
if (s.startY > s.endY || (s.startY == s.endY && s.startX > s.endX)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user