feat: add stroke thickness

This commit is contained in:
2026-03-05 00:51:20 +05:30
parent 8ac783e6e0
commit eefd95e4d2
15 changed files with 379 additions and 356 deletions

View File

@@ -6,42 +6,42 @@
#include "vector.h"
typedef struct {
V2 p1;
V2 p2;
V2 p1;
V2 p2;
} VektorLine;
typedef struct {
V2 *points;
size_t count;
size_t capacity;
V2 *points;
size_t count;
size_t capacity;
} VektorPolyline;
typedef struct {
V2 *points;
size_t count;
size_t capacity;
V2 *points;
size_t count;
size_t capacity;
} VektorPolygon;
typedef struct {
V2 center;
double radius;
V2 center;
double radius;
} VektorCircle;
typedef enum {
VEKTOR_LINE,
VEKTOR_POLYLINE,
VEKTOR_POLYGON,
VEKTOR_CIRCLE
VEKTOR_LINE,
VEKTOR_POLYLINE,
VEKTOR_POLYGON,
VEKTOR_CIRCLE
} VektorPrimitiveKind;
typedef struct {
VektorPrimitiveKind kind;
union {
VektorLine line;
VektorPolyline *polyline;
VektorPolygon *polygon;
VektorCircle circle;
};
VektorPrimitiveKind kind;
union {
VektorLine line;
VektorPolyline *polyline;
VektorPolygon *polygon;
VektorCircle circle;
};
} VektorPrimitive;
VektorPolyline *vektor_polyline_new(void);
@@ -53,9 +53,9 @@ void vektor_polygon_add_point(VektorPolygon *pl, V2 point);
void vektor_polygon_free(VektorPolygon *pl);
typedef struct {
VektorPrimitive *primitives;
size_t count;
size_t capacity;
VektorPrimitive *primitives;
size_t count;
size_t capacity;
} VektorPrimitiveBuffer;
void vektor_primitivebuffer_add_primitive(VektorPrimitiveBuffer *edges,