Skip to content

Add Shape controls and vector geometry - #53

Merged
ProGraMajster merged 1 commit into
masterfrom
codex/issue-11-shapes-vector-geometry
Aug 14, 2026
Merged

Add Shape controls and vector geometry#53
ProGraMajster merged 1 commit into
masterfrom
codex/issue-11-shapes-vector-geometry

Conversation

@ProGraMajster

Copy link
Copy Markdown
Owner

Summary

Adds a complete, platform-neutral Shape and vector-geometry subsystem to ModernFormsNext. The implementation follows the existing Skia rendering, Brush, layout, input, accessibility, and Designer pipelines without introducing platform types into shared projects.

Closes #11.

Implementation

  • Adds the Shape base control and Ellipse, Circle, Line, Polygon, Polyline, and Path controls.
  • Adds a platform-neutral Geometry model with ellipse, rectangle, line, and path geometries.
  • Adds path figures and line, quadratic Bézier, and cubic Bézier segments.
  • Supports fill rules, point collections, geometry transforms, and mutable collection notifications.
  • Preserves Circle semantics while keeping stroke rendering safe at small sizes.

Designer integration

  • Registers Shape controls with the Toolbox and Property Grid.
  • Adds structured editors for PointCollection and PathGeometry.
  • Adds Designer defaults, serialization, code generation, reverse parsing, and round-trip coverage.
  • Corrects ColorDialog client sizing used by the Designer brush workflow.

Rendering and hit testing

  • Reuses the shared Brush and Skia pipelines for solid, linear, radial, and sweep fills and strokes.
  • Supports stroke thickness, caps, joins, clipping, presentation transforms, and antialiased vector rendering.
  • Adds geometry-aware pointer hit testing for transparent fill regions and thin strokes.
  • Invalidates cached Skia paths and paints when mutable Geometry or Brush content changes.
  • Keeps the implementation shared by Windows and Android backends.

Serialization and code generation

  • Extends .mfdesign persistence for Shape controls, points, figures, segments, transforms, fill rules, and brush values.
  • Generates code for structured vector geometry.
  • Extends reverse parsing so generated Shape code can be reopened by the Designer.
  • Adds compatibility aliases where the public ModernFormsNext.Path name would otherwise conflict with System.IO.Path.

Testing

  • dotnet restore .\ModernFormsNext.slnx
  • Full Debug solution build, including the Android backend and VSIX validation.
  • Full Release solution build, including the Android backend and VSIX validation.
  • Explicit Debug and Release VSIX builds.
  • Full test suite: 1062/1062 passed, 0 failed, 0 skipped.
  • git diff --check passed.
  • Validation was run in a clean isolated copy to avoid live Designer host locks and nested worktree contamination.

Manual validation

Manually verified on Windows:

  • ControlGallery Shapes page, including resize and move behavior.
  • Smooth transformed Path rendering after Geometry.Transform.
  • PointCollection and PathGeometry structured editors.
  • Toolbox and Property Grid integration.
  • All Shape controls, including Circle sizing semantics.
  • Fill, stroke, gradients, caps, joins, clipping, transforms, and geometry-aware hit testing.

Known limitations

  • Android build and automated tests are validated, but no manual Android emulator or physical-device run is claimed.
  • PathGeometry uses a structured Designer editor; this change does not add a graphical Bézier canvas editor.

Add Shape base and Ellipse, Circle, Line, Polygon, Polyline, and Path controls.

Add a platform-neutral Geometry and PathGeometry model with line, quadratic, and cubic Bézier segments.

Support Fill, Stroke, gradient brushes, caps, joins, transforms, clipping, geometry-aware hit testing, and mutable Geometry/Brush cache invalidation.

Integrate Designer Toolbox and Property Grid support, structured Point/Path editors, .mfdesign serialization, code generation, reverse parsing, ControlGallery coverage, and extensive regression tests.

Keep rendering shared between Windows and Android through the Skia pipeline.
@ProGraMajster
ProGraMajster merged commit f3166f7 into master Aug 14, 2026
1 check passed
@ProGraMajster
ProGraMajster deleted the codex/issue-11-shapes-vector-geometry branch August 14, 2026 16:09
@github-project-automation github-project-automation Bot moved this from Backlog to Done in ModernFormsNext Roadmap Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add Shape controls and vector geometry

1 participant