We can reverse select

This commit is contained in:
Clement Roblot 2024-11-26 21:39:29 +07:00 committed by ArthurSonzogni
parent 6c7a92cffa
commit 5c4a5b86bc
No known key found for this signature in database
GPG Key ID: 41D98248C074CD6C

View File

@ -94,7 +94,21 @@ void Render(Screen& screen, Node* node, Box selection) {
// Step 3: Selection // Step 3: Selection
std::vector<Box> selected; std::vector<Box> selected;
node->Selection(selection, &selected);
Box selectionCleaned = selection;
if(selection.x_min > selection.x_max)
{
selectionCleaned.x_min = selection.x_max;
selectionCleaned.x_max = selection.x_min;
}
if(selection.y_min > selection.y_max)
{
selectionCleaned.y_min = selection.y_max;
selectionCleaned.y_max = selection.y_min;
}
node->Selection(selectionCleaned, &selected);
// Step 4: Draw the element. // Step 4: Draw the element.
screen.stencil = box; screen.stencil = box;