perf: reduce repaints amount caused by selection (#4889)

Co-authored-by: nerix <nero.9@hotmail.de>
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
kornes
2023-10-13 17:19:52 +00:00
committed by GitHub
parent cbc2d3d683
commit ccaedc3987
4 changed files with 26 additions and 34 deletions
+11 -1
View File
@@ -38,7 +38,7 @@ struct SelectionItem {
bool operator!=(const SelectionItem &b) const
{
return this->operator==(b);
return !this->operator==(b);
}
};
@@ -62,6 +62,16 @@ struct Selection {
}
}
bool operator==(const Selection &b) const
{
return this->start == b.start && this->end == b.end;
}
bool operator!=(const Selection &b) const
{
return !this->operator==(b);
}
bool isEmpty() const
{
return this->start == this->end;