fix: change ArcCircleInstruction radius from Point to Unit; assertion for safety

This commit is contained in:
2026-05-18 18:42:41 +02:00
parent c85faf16b4
commit 77a1e7ae1d
+2 -1
View File
@@ -127,7 +127,7 @@ CubicBezierInstruction :: struct {
ArcCircleInstruction :: struct { ArcCircleInstruction :: struct {
large_arc: bool, large_arc: bool,
sweep: bool, sweep: bool,
radius: Point, radius: Unit,
target: Point, target: Point,
} }
ArcEllipseInstruction :: struct { ArcEllipseInstruction :: struct {
@@ -581,6 +581,7 @@ read_unit :: proc(r: ^Reader, header: Header) -> (unit: f32, err: Error) {
@(private, require_results) @(private, require_results)
read_path :: proc(r: ^Reader, header: Header, segment_count: u32) -> (path: Path, err: Error) { read_path :: proc(r: ^Reader, header: Header, segment_count: u32) -> (path: Path, err: Error) {
assert(segment_count <= 1024) // arbitrary limit to avoid unbounded allocations on malformed input
segments_instructions: [1024]u32 segments_instructions: [1024]u32
segments := make([]Segment, segment_count) segments := make([]Segment, segment_count)