[glyf/path-builder] Simplify initialization

This commit is contained in:
Behdad Esfahbod 2022-06-26 13:18:00 -06:00
parent b2abd5c7e8
commit 65b066f18e
1 changed files with 5 additions and 5 deletions

View File

@ -16,12 +16,12 @@ struct path_builder_t
struct optional_point_t
{
optional_point_t () { has_data = false; }
optional_point_t (float x_, float y_) { x = x_; y = y_; has_data = true; }
optional_point_t () {}
optional_point_t (float x_, float y_) : has_data (true), x (x_), y (y_) {}
bool has_data;
float x;
float y;
bool has_data = false;
float x = 0.;
float y = 0.;
optional_point_t lerp (optional_point_t p, float t)
{ return optional_point_t (x + t * (p.x - x), y + t * (p.y - y)); }