Fix multiple cursors crashes by sorting cursors by min range

This commit is contained in:
Krzosa Karol
2024-06-24 07:27:38 +02:00
parent 66b9a5d15f
commit 84f0b65fa9
3 changed files with 94 additions and 8 deletions

View File

@@ -95,6 +95,13 @@ T Clamp(T value, T min, T max) {
return value;
}
template <class T>
void Swap(T *a, T *b) {
T temp = *a;
*a = *b;
*b = temp;
}
inline bool IsPowerOf2(size_t x) {
size_t result = (((x) & ((x)-1)) == 0);
return result;