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

@ -117,7 +117,7 @@ struct Ttf_font::Glyph_buffer
alloc(alloc),
/* glyphs are horizontally stretched by factor 4 */
capacity(4*(bounding_box.w() + PAD_X)*(bounding_box.h() + PAD_Y))
capacity(4*(bounding_box.w + PAD_X)*(bounding_box.h + PAD_Y))
{ }
~Glyph_buffer() { alloc.free(_values, _num_bytes()); }

View File

@ -113,8 +113,8 @@ struct Vfs_ttf::Local_factory : File_system_factory, Watch_response_handler
{
_baseline_fs .value(_font->font.font().baseline());
_height_fs .value(_font->font.font().height());
_max_width_fs .value(_font->font.font().bounding_box().w());
_max_height_fs.value(_font->font.font().bounding_box().h());
_max_width_fs .value(_font->font.font().bounding_box().w);
_max_height_fs.value(_font->font.font().bounding_box().h);
}
Local_factory(Vfs::Env &env, Xml_node config)