import SwiftUI /// Subtle grid, mirrors the makima.jp body background texture. /// Drawn as a `Canvas` so there's no asset dependency. struct GridOverlay: View { var spacing: CGFloat = 32 var opacity: Double = 0.04 var body: some View { Canvas { ctx, size in let color = GraphicsContext.Shading.color(.white.opacity(opacity)) var path = Path() var x = spacing while x < size.width { path.move(to: CGPoint(x: x, y: 0)) path.addLine(to: CGPoint(x: x, y: size.height)) x += spacing } var y = spacing while y < size.height { path.move(to: CGPoint(x: 0, y: y)) path.addLine(to: CGPoint(x: size.width, y: y)) y += spacing } ctx.stroke(path, with: color, lineWidth: 0.5) } .allowsHitTesting(false) } }