Changelog for gb-vector-0.1.0.3
Changelog
0.1.0.3
Bug Fixes
- Fix SVG parser failing to parse
width/heighton<svg>tags containing URL attributes (e.g.xmlns="http://..."). The/in quoted URLs was prematurely terminating the tag scan, causing round-triprender → parseSvgto lose document dimensions.
Improvements
- 523 tests (was 294), 92% HPC expression coverage across all 17 modules
0.1.0.2
Improvements
- Document all positional constructor arguments with
-- |comments for richer API docs on Hackage - Upgrade tested GHC from 9.6.7 to 9.8.4
- Fix GHC 9.8
-Wcompatwarnings (head/lastreplaced with pattern matching)
Affected Types
V2,ViewBox,Segment,Color— all constructor arguments documentedElement— all 30 constructors' positional arguments documentedFill,Gradient,FilterKind— all constructor arguments documentedParseError—MalformedTagandMalformedPatharguments documented
0.1.0.1
Bug Fixes
- Fix arc segments silently replaced with straight lines in Boolean ops and PathOps
- Fix arc length measurement using straight-line distance instead of true arc length
- Fix
subpathpotential overflow whent0is very close to 1 - Fix test suite leaving temporary SVG files in project root
Improvements
cubicLengthnow uses adaptive flattening instead of uniform sampling for better accuracygrad2Dexpanded from 4 to 8 gradient directions for better noise isotropy- 100% Haddock coverage across all 17 modules (was 64%)
- Document Sutherland-Hodgman convexity requirement on
intersectionanddifference - Document
unionbehavior with non-overlapping polygons - Document
intersectEpsilonas absolute tolerance - 9 new tests (294 total): arc flattening, arc measurement, arc boolean ops, subpath edge case, saturate safety, noise determinism, arcToCubics validation
Internal
- Add
directoryto test suite dependencies for temp file cleanup
0.1.0.0
Initial release.
Core Types
V22D vector,Segment(line/cubic/quad/arc),Path(closed/open)Colortype with RGBA in[0, 1]—rgb,rgba,rgb8,hexconstructors- 43 named colors,
lerp,withAlpha,toHex hsl,hsla— HSL color construction- Oklab perceptual color space:
toOklab,fromOklab,lerpOklab - Color adjustments:
lighten,darken,saturate,desaturate,invert
Element Tree
Elementrecursive sum type — style and transforms as wrapping constructors- Compose via function application or left-to-right with
(&) Semigroup/Monoidinstance viaEGroup
Shapes
circle,rect,roundedRect,ellipse,polygon,starline,square,regularPolygon,arc,ring
Path DSL
buildPath— run aPathBuildermonad to produce aPathPathBuilderactions:startAt,lineTo,cubicTo,quadTo,arcTo,closePathpolylinePath,polygonPathconvenience constructors
Path Operations
reversePath,measurePath— reversal and arc lengthsplitPathAt,subpath— splitting and extractionoffsetPath— parallel curve approximationsimplifyPath— Ramer-Douglas-Peucker simplification
Boolean Operations
union,intersection,difference,xorPaths— polygon clippingpathToPolygon,polygonToPath— conversion utilitiespolygonArea,pointInPolygon— polygon analysis
Transforms
translate,rotate,rotateAround,scale,scaleXY,skewX,skewYMatrixtype withidentity,composeMatrix,applyMatrix- Matrix constructors:
translateM,rotateM,scaleM,scaleXYM,skewXM,skewYM
Gradients
linearGradient,radialGradient— gradient constructorsstop,stopWithOpacity,evenStops,oklabStops— gradient stop builders
Style
fill,fillColor,fillGradient,fillNone,fillRulestroke,strokeEx,dashedStroke,defaultStrokeConfigopacity,clip,mask,blur,dropShadowwithId,use,raw,title,desc
Text
text,textAt,textWithConfig— text element constructorsdefaultTextConfig,fontSize,fontFamily,bold,italic,anchor— config builders
Noise
perlin2D,simplex2D— deterministic 2D noisefbm— fractional Brownian motionnoisePath,noiseClosedPath— procedural path generationwobblePath,jitterPoints— noise-driven distortionvoronoiCells,voronoiEdges— Voronoi diagram generation
Patterns
dotGrid,lineGrid,crosshatch,checker— tileable pattern generatorspatternDef,PatternConfig,defaultPatternConfig— SVG pattern element construction
SVG Parsing
parseSvg,parseElement— parse SVG text back toElementtrees- Supports basic shapes, paths, groups, text, and presentation attributes
- Enables round-trip workflows: render, parse, manipulate, re-export
Composition
group,empty,document,documentWithViewBox,backgroundoptimizeElement— collapse redundant transforms and empty groups
SVG Output
render :: Document -> Text— pure SVG serializationrenderCompact :: Document -> Text— compact SVG outputrenderElement :: Element -> Text— render a fragment without<svg>wrapperwriteSvg :: FilePath -> Document -> IO ()— file output