Skip to content

Fix polygon stroke vertex deduplication - #7362

Open
ICOM725 wants to merge 1 commit into
phaserjs:masterfrom
ICOM725:fix/polygon-stroke-vertices
Open

Fix polygon stroke vertex deduplication#7362
ICOM725 wants to merge 1 commit into
phaserjs:masterfrom
ICOM725:fix/polygon-stroke-vertices

Conversation

@ICOM725

@ICOM725 ICOM725 commented Sep 5, 2026

Copy link
Copy Markdown

This PR

  • Fixes a bug

Describe the changes below:

Compare consecutive stroke vertices in the same coordinate space. The existing check compares the current origin-adjusted vertex with the previous unadjusted vertex, which can skip distinct corners or retain duplicate vertices when the display origin is non-zero.

Add regression tests for the centered diamond in #7361, consecutive duplicate vertices with zero and non-zero display origins, and open paths.

Fixes #7361.

Validation:

  • The new tests reproduce the bug before the fix (3 failed, 1 passed).
  • npm test -- tests/gameobjects/shape --maxWorkers=2: 320 tests passed.
  • npm run build: webpack compilation passed; the optional copy-to-examples step reports a missing sibling examples directory.
  • Targeted ESLint 8.57.1 checks passed for both changed files using the repository configuration and test globals.
  • git diff --check passed.

The repository's npm run lint command fails to load its legacy JSON configuration with the installed ESLint 10 (ERR_IMPORT_ATTRIBUTE_MISSING). No dependency or lint configuration changes are included.

@ICOM725
ICOM725 marked this pull request as ready for review September 7, 2026 06:15
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.

WebGL stroke of a Polygon drops a vertex when its origin-shifted position equals the previous raw vertex

1 participant