Start the tree-aware selection.

This commit is contained in:
ArthurSonzogni
2024-11-13 22:05:04 +01:00
parent 3e9bab424e
commit 5ecac2e8d6
12 changed files with 195 additions and 165 deletions

View File

@@ -11,13 +11,10 @@ struct Box {
int x_max = 0;
int y_min = 0;
int y_max = 0;
bool isXInverted = false; // false means the box box from x_min to x_max (in the case of a selection for example)
bool isYInverted = false; // false means the box box from y_min to y_max (in the case of a selection for example)
static auto Intersection(Box a, Box b) -> Box;
static auto Union(Box a, Box b) -> Box;
bool Contain(int x, int y) const;
Box Clean() const;
bool IsEmpty() const;
bool operator==(const Box& other) const;
bool operator!=(const Box& other) const;

View File

@@ -63,12 +63,6 @@ class Screen : public Image {
Cursor cursor() const { return cursor_; }
void SetCursor(Cursor cursor) { cursor_ = cursor; }
bool selection_enabled = false;
CapturedMouse selection_pending;
Box mouse_selection_region;
Box selection_region;
std::string selection_text;
// Store an hyperlink in the screen. Return the id of the hyperlink. The id is
// used to identify the hyperlink when the user click on it.
uint8_t RegisterHyperlink(const std::string& link);