feat: add bounding box calculation

This commit is contained in:
2026-03-08 12:08:24 +05:30
parent e48858defe
commit ce28f0d350
3 changed files with 81 additions and 2 deletions

View File

@@ -51,12 +51,26 @@ typedef struct {
float stroke_width;
} VektorStyle;
typedef struct {
V2 min;
V2 max;
} VektorBBox;
typedef struct {
VektorStyle style;
int z_index;
VektorBBox bbox;
VektorPrimitive primitive;
} VektorShape;
VektorBBox polyline_mk_bbox(VektorPrimitive prim);
VektorBBox polygon_mk_bbox(VektorPrimitive prim);
VektorBBox vektor_mk_bbox(VektorPrimitive prim);
VektorShape vektor_shape_new(VektorPrimitive prim, VektorStyle style,
int z_index);
typedef struct {
VektorShape* shapes;
size_t count;
@@ -64,5 +78,5 @@ typedef struct {
} VektorShapeBuffer;
void vektor_shapebuffer_add_shape(VektorShapeBuffer* buffer, VektorShape shape);
void vektor_shapes_update_bbox(VektorShapeBuffer* buffer);
#endif // PRIMITIVES_H_