mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-23 17:17:38 +00:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user