Fix routing, replace ILayoutAlgorithm, and resolve Note divider issue#21
Merged
Merged
Conversation
…orithmBase, fix Note-fold divider overlap - ConnectorRouter: stop excluding a connection's own endpoint boxes from the hard-obstacle set. Other connectors' soft obstacles could squeeze a route through its own target's interior (e.g. parallel edges converging on a compartment box). OrthogonalEdgeRouter's stub-then-dock approach already lets a connector leave/enter its own boxes cleanly, so removing the exclusion is a safe, minimal fix. Adds a regression test and a new gallery diagram (ParallelEdgesIntoCompartmentBox), and updates the connector-router design/requirements/verification docs to describe the corrected obstacle model. - Replace the ILayoutAlgorithm interface with an abstract LayoutAlgorithmBase class exposing a sealed public Apply(LayoutGraph) and a protected internal ApplyCore(LayoutGraph, LayoutOptions) extension point. This closes an API footgun where an external caller could pass LayoutOptions that contradicted a graph's own CoreOptions.Algorithm setting; external consumers can now only reach the single-argument Apply(graph), while HierarchicalLayoutAlgorithm's internal recursion and same-assembly tests retain access to ApplyCore via InternalsVisibleTo. Pure rename/access-modifier change with no behavior change to any leaf algorithm. - Fix a rendering defect where a Note-shaped box's compartment divider could be drawn above the bottom of the note's folded top-right corner, appearing as a stray line crossing the fold. The existing guard only protected the first compartment's divider; any later compartment (e.g. following an empty leading compartment) could still land in the fold region. Both SvgRenderer and SkiaRasterRenderer now clamp a Note's divider Y to the fold's bottom edge, using a new shared BoxMetrics.NoteFoldSize(box) helper that also deduplicates the fold-size math previously inlined separately in each renderer's outline-drawing code. Adds regression tests to both renderers' test suites. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several key improvements to the rendering layout system, focusing on the connector routing algorithm and the extensibility of layout algorithms. The most significant changes include a fix to the connector routing obstacle handling, a new extensibility base class for layout algorithms, and updates to documentation and tests to reflect these changes.
Connector Routing Improvements
Layout Algorithm Extensibility
LayoutAlgorithmBaseabstract class: Replaces the previousILayoutAlgorithminterface with a more extensible base class, supporting single-surface configuration and composite algorithm recursion. This change simplifies the contract and enables internal extensibility without exposing additional public API. [1] [2]LayoutAlgorithmRegistryand related documentation are updated to use and referenceLayoutAlgorithmBaseinstead of the old interface, ensuring consistency across the API. [1] [2] [3] [4] [5]Miscellaneous Improvements
NoteFoldSizetoBoxMetricsfor consistent geometry and content clearance around Note-shaped boxes.InternalsVisibleTofor layout assemblies and enabled embedded attribute polyfill for improved internal access and compatibility. [1] [2]