mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-06-26 01:21:12 +08:00
Wrap around both directions
This commit is contained in:
parent
195871e62b
commit
c9fbd8de9d
@ -41,19 +41,28 @@ class Text : public Node {
|
|||||||
if (cell == "\n") {
|
if (cell == "\n") {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
screen.PixelAt(x, y).character = cell;
|
Pixel ¤tPixel = screen.PixelAt(x, y);
|
||||||
if(screen.PixelAt(x, y).selectable == true)
|
currentPixel.character = cell;
|
||||||
|
|
||||||
|
if(currentPixel.selectable == true)
|
||||||
{
|
{
|
||||||
if(screen.selection_region.Contain(x, y)) {
|
if(screen.selection_region.Contain(x, y)) {
|
||||||
screen.PixelAt(x, y).inverted ^= true;
|
currentPixel.inverted ^= true;
|
||||||
screen.selection_text += screen.PixelAt(x, y).character;
|
screen.selection_text += currentPixel.character;
|
||||||
}
|
}
|
||||||
else if(screen.selection_region.x_min <= x && screen.selection_region.x_max <= x &&
|
else if(screen.selection_region.x_min <= x && screen.selection_region.x_max <= x &&
|
||||||
screen.selection_region.y_min <= y && screen.selection_region.y_max > y)
|
screen.selection_region.y_min <= y && screen.selection_region.y_max > y)
|
||||||
{
|
{
|
||||||
screen.PixelAt(x, y).inverted ^= true;
|
currentPixel.inverted ^= true;
|
||||||
screen.selection_text += screen.PixelAt(x, y).character;
|
screen.selection_text += currentPixel.character;
|
||||||
}
|
}
|
||||||
|
else if(screen.selection_region.x_min >= x && screen.selection_region.x_max >= x &&
|
||||||
|
screen.selection_region.y_min < y && screen.selection_region.y_max >= y)
|
||||||
|
{
|
||||||
|
currentPixel.inverted ^= true;
|
||||||
|
screen.selection_text += currentPixel.character;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
++x;
|
++x;
|
||||||
|
Loading…
Reference in New Issue
Block a user