Skip to content

refactor(renderer): simplify stroke width handling and remove unused … - #28

Merged
NiceArti merged 1 commit into
mainfrom
dev
Aug 4, 2026
Merged

refactor(renderer): simplify stroke width handling and remove unused …#28
NiceArti merged 1 commit into
mainfrom
dev

Conversation

@NiceArti

@NiceArti NiceArti commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

This pull request improves stroke rendering, canvas navigation, touch interaction, hover feedback, and package readiness across the Flowscape core SDK and documentation.

It adds dotted stroke support, prevents browser navigation gestures over the canvas, introduces one-finger touch panning, restores shape-accurate hover contours, and updates documentation examples to match the current SDK API.

Motivation

Several rendering and interaction behaviors were incomplete or had regressed:

  • StrokeStyle.Dotted existed but was not rendered correctly.
  • Horizontal trackpad gestures over the canvas could trigger browser back navigation.
  • The world camera could not be panned with one finger on touch devices.
  • Hover feedback displayed rectangular bounds instead of the real node geometry.
  • Documentation examples still used outdated stroke-width APIs.
  • Documentation type checking failed because optional preview configuration values were not fully resolved.
  • The unfinished inner-shadow renderer blocked the package build.

These changes make the editor interaction more consistent across desktop and mobile devices and prepare the SDK for publication.

Changes

  • Added dotted stroke rendering using the existing geometric dashed-stroke pipeline.

  • Added round caps and appropriate dot sizing for dotted strokes.

  • Preserved color and gradient stroke support for dotted rendering.

  • Prevented default wheel and trackpad browser behavior over registered canvas surfaces.

  • Added local touch-action and overscroll-behavior handling to canvas surfaces.

  • Added one-finger camera panning through the existing Pointer Events input system.

  • Added active-pointer filtering and accumulated pointer movement deltas.

  • Prevented initial touch movement jumps by resetting pointer position on pointerdown.

  • Restored shape-accurate hover outlines using node path commands instead of world bounding-box corners.

  • Added hover contour processing for:

    • line segments;
    • quadratic curves;
    • elliptical arcs;
    • closed subpaths.
  • Temporarily disabled unfinished inner-shadow rendering while preserving its renderer contract.

  • Updated documentation examples from the old per-side stroke-width object to the current numeric setStrokeWidth() API.

  • Fixed optional debug flags by resolving undefined values to false.

  • Fixed preview configuration resolution for required background logo dimensions.

  • Updated documentation TypeScript path aliases for the local SDK workspace and Docusaurus @site imports.

  • Updated package versioning scripts to use a supported version command.

Testing

Tested manually in the Playground and documentation application.

Verified:

  • Dotted strokes render correctly on rectangles, rounded rectangles, ellipses, polygons, and stars.
  • Dotted strokes support different widths, spacing values, colors, and gradient fills.
  • Existing dashed strokes continue to render correctly.
  • Horizontal trackpad gestures pan the canvas without triggering browser back navigation.
  • Browser scrolling and navigation remain available outside the canvas.
  • One-finger touch movement pans the world camera.
  • Pointer capture keeps an active gesture working outside the original canvas bounds.
  • Hover outlines follow the actual geometry of curved and polygonal nodes.
  • Documentation examples compile with the current stroke API.
  • Documentation local imports and SDK workspace imports resolve correctly.
  • The unfinished inner-shadow effect no longer blocks the build.

Public API

  • No public API changes
  • Public API was added or changed
  • Breaking change

The changes use existing public APIs. Documentation examples were updated to match the already-current setStrokeWidth(number) API.

Visual changes

Recommended attachments:

  • Dotted stroke examples using solid colors and gradients.
  • Before-and-after comparison of rectangular hover bounds and shape-accurate hover contours.
  • Recording of trackpad panning without browser navigation.
  • Recording of one-finger touch panning on a mobile device or touch emulator.

Checklist

  • The project builds successfully
  • Type checking passes
  • Linting passes
  • Tests pass
  • Relevant behavior was tested in the Playground
  • New behavior has tests where practical
  • Documentation was updated where necessary
  • CHANGELOG.md was updated where necessary
  • No unrelated refactoring was included

@NiceArti
NiceArti merged commit ebcf544 into main Aug 4, 2026
1 check 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