Skip to content

feat(offscreen): fit-to-content rendering + deps update (v0.1.17)#89

Merged
kolkov merged 2 commits intomainfrom
feat/v0.1.17-fit-to-content-deps
May 1, 2026
Merged

feat(offscreen): fit-to-content rendering + deps update (v0.1.17)#89
kolkov merged 2 commits intomainfrom
feat/v0.1.17-fit-to-content-deps

Conversation

@kolkov
Copy link
Copy Markdown
Contributor

@kolkov kolkov commented May 1, 2026

Summary

  • offscreen.WithFitSize() — measure widget preferred size before canvas allocation (ADR-008, offscreen.NewRenderer fit-to-content #87 @AgentNemo00)
  • offscreen.WithMaxSize(w, h) — constrain expansion for unbounded widgets
  • Flutter/Qt6/SwiftUI/Compose measure-then-render pattern
  • 5 new tests (16 total)
  • deps: gg v0.43.7, gogpu v0.31.0, gpucontext v0.16.0, wgpu v0.26.12, naga v0.17.10

Test plan

  • 16 offscreen tests pass
  • golangci-lint 0 issues
  • go fmt clean
  • Build OK

kolkov added 2 commits May 1, 2026 13:07
- WithFitSize() option: measure widget preferred size before allocating canvas
- WithMaxSize(w, h) option: constrain expansion for unbounded widgets
- measure-then-render pattern (Flutter/Qt6/SwiftUI/Compose enterprise standard)
- maxFitDimension=4096 safety cap for infinite-expansion widgets
- 5 new tests: fit text, fit box, max size, background, explicit dims ignored
- All 16 offscreen tests pass
- offscreen.WithFitSize(): measure widget preferred size before canvas allocation
- offscreen.WithMaxSize(w, h): constrain expansion for unbounded widgets
- 5 new tests (16 total offscreen tests pass)
- deps: gg v0.43.7, gogpu v0.31.0, gpucontext v0.16.0, wgpu v0.26.12, naga v0.17.10
- examples: all deps updated
@kolkov kolkov force-pushed the feat/v0.1.17-fit-to-content-deps branch from 640eba6 to 5bdd21b Compare May 1, 2026 10:08
@codecov
Copy link
Copy Markdown

codecov Bot commented May 1, 2026

Codecov Report

❌ Patch coverage is 77.14286% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
offscreen/renderer.go 77.14% 4 Missing and 4 partials ⚠️

📢 Thoughts on this report? Let us know!

@kolkov kolkov merged commit 0f08ca8 into main May 1, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant