feat(experimental): add selection tool

This commit is contained in:
Beriff
2026-03-10 15:55:02 +07:00
parent 232b5c8f90
commit 1d168f7be4
9 changed files with 65 additions and 18 deletions

View File

@@ -135,6 +135,11 @@ VektorBBox vektor_primitive_get_bbox(VektorPrimitive prim) {
}
}
bool vektor_bbox_isinside(VektorBBox bbox, V2 point) {
return point.x >= bbox.min.x && point.y >= bbox.min.y
&& point.x <= bbox.max.x && point.y <= bbox.max.y;
}
VektorShape vektor_shape_new(VektorPrimitive prim, VektorStyle style,
int z_index) {
return (VektorShape){.primitive = prim, .style = style, .z_index = z_index, .bbox=vektor_primitive_get_bbox(prim)};

View File

@@ -80,6 +80,7 @@ VektorBBox vektor_polygon_get_bbox(VektorPrimitive prim);
VektorBBox vektor_rectangle_get_bbox(VektorPrimitive prim);
VektorBBox vektor_primitive_get_bbox(VektorPrimitive prim);
bool vektor_bbox_isinside(VektorBBox bbox, V2 point);
VektorShape vektor_shape_new(VektorPrimitive prim, VektorStyle style,
int z_index);