Move to more memory safe implementation of widget holding

This commit is contained in:
2025-12-12 15:35:32 +02:00
parent ddc7898a78
commit 8e276ab2ab
6 changed files with 16 additions and 17 deletions

View File

@@ -97,7 +97,7 @@ void WidgetRect::draw()
}
}
Widget* WidgetRect::builder(const nlohmann::json& j)
std::unique_ptr<Widget> WidgetRect::builder(const nlohmann::json& j)
{
int x = 0;
int y = 0;
@@ -115,7 +115,7 @@ Widget* WidgetRect::builder(const nlohmann::json& j)
json_extract(j, "stroke", stroke_size);
json_extract(j, "color", color);
return new WidgetRect(x, y, width, height, radius, stroke_size, color);
return std::make_unique<WidgetRect>(x, y, width, height, radius, stroke_size, color);
}
void WidgetRect::draw_circle_corner(int x, int y, int quadrant)