Make util/geometry.h C++20 friendly

- Move header to base/include to make it applicable for base types
  like 'Affinity' down the road.
- Represent 'Rect' as typle of point and area, which is the most
  common form of initialization, creates in valid 'Rect' by default.
- Turn Point, Area, and Rect into compound types, making x, y, w, h, at,
  area accessible without a method call
- 'Rect::Compound' function for constructing a 'Rect' from two points,
  replacing a former constructor
- Use result type 'Rect::Cut_remainder' instead of out parameters.

Fixes #5239
This commit is contained in:
Norman Feske
2024-06-05 12:40:13 +02:00
parent bb06d879aa
commit c629c54153
131 changed files with 1200 additions and 1218 deletions

View File

@ -88,8 +88,8 @@ class Scout::Element
*/
virtual void geometry(Rect rect)
{
_position = rect.p1();
_size = rect.area();
_position = rect.at;
_size = rect.area;
}
/**
@ -184,7 +184,7 @@ class Scout::Element
/**
* Trigger the refresh of an element on screen
*/
void refresh() { redraw_area(0, 0, _size.w(), _size.h()); }
void refresh() { redraw_area(0, 0, _size.w, _size.h); }
/**
* Handle user input or timer event