mirror of
https://github.com/1j01/textual-paint.git
synced 2024-12-21 13:51:45 +03:00
Fix cells inverted outside the textbox to the left of the selection after closing a menu over the region
Normally, only the region with the textbox is updated, when the text selection changes, but if the canvas is refreshed by other means, like a menu, it can show up.
This commit is contained in:
parent
f6b94f67c4
commit
06e2ad41e4
2
paint.py
2
paint.py
@ -1115,7 +1115,7 @@ class Canvas(Widget):
|
||||
assert style.color is not None
|
||||
assert style.bgcolor is not None
|
||||
def within_text_selection_highlight(textbox: Selection) -> int:
|
||||
if cell_x >= textbox.region.right:
|
||||
if cell_x >= textbox.region.right or cell_x < textbox.region.x:
|
||||
# Prevent inverting outside the textbox.
|
||||
return False
|
||||
def offset_to_text_index(offset: Offset) -> int:
|
||||
|
Loading…
Reference in New Issue
Block a user