Skip to content

Commit

Permalink
Opt Shape out of auto filter focus, to preserve stroke around the edges.
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminDRichards committed Mar 10, 2025
1 parent 2601359 commit aa7f4d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog/4.0/CHANGELOG-v4.0-beta-7.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ The new system fixes many issues with nested transforms, filters, and other uses
- Add creation time to `SpriteGPULayer` members.
- Add documentation for writing a `Extern#render` function.
- `TilemapLayer` and `TilemapGPULayer` now support a parent matrix during rendering.
- `Shape` now sets `filtersFocusContext = true` by default, to prevent clipping stroke off at the edges.

## Fixes and Tweaks

Expand Down
6 changes: 6 additions & 0 deletions src/gameobjects/shape/Shape.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,12 @@ var Shape = new Class({
*/
this.height = 0;

if (this.enableFilters)
{
// Prevent Shape stroke from being cut off in filters.
this.filtersFocusContext = true;
}

this.initRenderNodes(this._defaultRenderNodesMap);
},

Expand Down

0 comments on commit aa7f4d7

Please sign in to comment.