Skip to content

Backport improvements from TechPizzaDev fork. - #366

Merged
JimBobSquarePants merged 37 commits into
SixLabors:mainfrom
TechPizzaDev:js/updates-to-backport
Oct 30, 2025
Merged

Backport improvements from TechPizzaDev fork.#366
JimBobSquarePants merged 37 commits into
SixLabors:mainfrom
TechPizzaDev:js/updates-to-backport

Conversation

@JimBobSquarePants

Copy link
Copy Markdown
Member

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following matches the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

Note: Most of the work here was done by @TechPizzaDev

This PR introduces several improvements and refactorings across the drawing and shapes components of the codebase. The most significant changes include refactoring the ComplexPolygon and EllipsePolygon classes for better performance and maintainability, updating the handling of Bezier and Arc line segments, and making various code quality and style improvements. Below are the most important changes grouped by theme:

Shapes and Geometry Refactoring

  • Refactored ComplexPolygon to lazily compute bounds and internal paths, reducing upfront computation and improving performance. Introduced helper methods for internal path initialization and bounds calculation.
  • Refactored EllipsePolygon to inherit from Polygon and removed redundant internal state. Updated transformation logic to work with the new structure, simplifying the class and aligning it with other shape types.
  • Added new PolygonStroker class designed to replace PolygonOffsetter

Line Segment Improvements

  • Updated CubicBezierLineSegment and ArcLineSegment to compute EndPoint and Flatten() lazily, improving efficiency and consistency. Added a convenience constructor and a method to retrieve control points for Bezier segments.

Code Quality and Style

  • Improved pattern and variable naming for clarity and consistency (e.g., opaque constant, use of slice syntax).
  • Removed unused usings and unnecessary project properties, and made minor code cleanups throughout the codebase.

Miscellaneous Fixes

  • Fixed a bug in RichTextGlyphRenderer by referencing the correct path list.
  • Updated the Visual Studio solution file for compatibility with Visual Studio 2022 (v18).

@JimBobSquarePants
JimBobSquarePants merged commit dd8f167 into SixLabors:mainOct 30, 2025
15 checks passed
Sign up for freeto 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.

3 participants

@JimBobSquarePants@TechPizzaDev