ws-cleanup-types: Types, api, host: honest annotations; return the full annotated value count

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
4DBugandClaude Opus 5.5 committed 2026-10-31 10:43:19 -05:00
1 parent e35de41c9f
commit 2c15b97cd8
22 files changed
+147 -147

No files matched your search

+7 -7
View File
@@ -159,12 +159,12 @@ local function flatten(path: any, transform: Transform?, tolerance: number?, min
local cmds = commands(path)
local polys: { { number } } = {}
if not cmds then
return polys
return polys, nil, nil, nil, nil
end
local m = transform or Raster.IDENTITY
local a, b, c, d, e, f = m[1], m[2], m[3], m[4], m[5], m[6]
if type(a) ~= "number" or type(b) ~= "number" or type(c) ~= "number" or type(d) ~= "number" or type(e) ~= "number" or type(f) ~= "number" then
return polys
return polys, nil, nil, nil, nil
end
local tol = tolerance or 0.1
if type(tol) ~= "number" or not (tol > 0.001) then
@@ -271,7 +271,7 @@ local function flatten(path: any, transform: Transform?, tolerance: number?, min
table.insert(polys, cur)
end
if #polys == 0 or bx0 ~= bx0 or by0 ~= by0 or bx1 ~= bx1 or by1 ~= by1 then
return polys
return polys, nil, nil, nil, nil
end
return polys, bx0, by0, bx1, by1
end
@@ -411,7 +411,7 @@ function Raster.mask(path: any, opts: Options?): (Mask?, string?)
local o: Options = opts or {}
local polys, bx0, by0, bx1, by1 = Raster.flatten(path, o.transform, o.tolerance)
if not bx0 then
return nil
return nil, nil
end
if abs(bx0 :: number) > LIMIT or abs(by0 :: number) > LIMIT or abs(bx1 :: number) > LIMIT or abs(by1 :: number) > LIMIT then
return nil, "coordinates out of range"
@@ -427,7 +427,7 @@ function Raster.mask(path: any, opts: Options?): (Mask?, string?)
end
local W, H = X1 - X0, Y1 - Y0
if W <= 0 or H <= 0 then
return nil
return nil, nil
end
local maxPixels = if type(o.maxPixels) == "number" then o.maxPixels else 2 ^ 26
if W * H > maxPixels then
@@ -464,7 +464,7 @@ function Raster.mask(path: any, opts: Options?): (Mask?, string?)
writeu8(cov, os + x, floor(v * 255 + 0.5))
end
end
return { x = X0, y = Y0, width = W, height = H, coverage = cov }
return { x = X0, y = Y0, width = W, height = H, coverage = cov }, nil
end
-- ------------------------------------------------------------------------------------------------ filling
@@ -533,7 +533,7 @@ function Raster.fill(img: any, path: any, paint: any, opts: Options?): (boolean,
end
end
end
return true
return true, nil
end
-- ------------------------------------------------------------------------------------------------ stroking