More intuitive selection of text

This commit is contained in:
Clement Roblot
2024-10-31 21:34:53 +07:00
committed by ArthurSonzogni
parent c9fbd8de9d
commit 92586f76bc

View File

@@ -50,14 +50,14 @@ class Text : public Node {
currentPixel.inverted ^= true; currentPixel.inverted ^= true;
screen.selection_text += currentPixel.character; screen.selection_text += currentPixel.character;
} }
else if(screen.selection_region.x_min <= x && screen.selection_region.x_max <= x && else if((x >= screen.selection_region.x_min) && (x >= screen.selection_region.x_max) &&
screen.selection_region.y_min <= y && screen.selection_region.y_max > y) (y >= screen.selection_region.y_min) && (y < screen.selection_region.y_max))
{ {
currentPixel.inverted ^= true; currentPixel.inverted ^= true;
screen.selection_text += currentPixel.character; screen.selection_text += currentPixel.character;
} }
else if(screen.selection_region.x_min >= x && screen.selection_region.x_max >= x && else if((x <= screen.selection_region.x_min) && (x <= screen.selection_region.x_max) &&
screen.selection_region.y_min < y && screen.selection_region.y_max >= y) (y > screen.selection_region.y_min) && (y <= screen.selection_region.y_max))
{ {
currentPixel.inverted ^= true; currentPixel.inverted ^= true;
screen.selection_text += currentPixel.character; screen.selection_text += currentPixel.character;