`Controller.paddingOverride` default prevents Glow filter from calculating framebuffer padding
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- javascript
- 領域
- game-dev
調査の方向性
src/filters/Controller.js の paddingOverride の初期化から始め、src/filters/Glow.js の Glow.getPadding() と比較してください。透明なスプライトを使った最小再現で、デフォルトでは Glow のパディングが距離から計算される一方、setPaddingOverride() によって明示的な上書きも引き続き可能であることを確認してください。Glow がスプライトの端からはみ出してもクリップされなければ完了です。
索引モデルが issue の本文から書いたものです。
説明
Version
- Phaser Version: 4.0.0 RC6
- Operating system: Linux
- Browser: Chrome 133
Description
The Controller base class initializes paddingOverride to new Rectangle() (Controller.js:67), which is a zero-valued but truthy object.
The Glow filter overrides getPadding() and checks if (this.paddingOverride) before falling through to its own distance-based padding calculation (Glow.js:218). Since paddingOverride is always truthy, the Glow's distance * scale calculation never executes, and the framebuffer gets zero extra padding.
Expected: Glow extends beyond the sprite outline by distance pixels, following the alpha edges of the opaque pixels.
Actual: Glow is confined within the sprite's rectangular bounds and abruptly cuts off at the frame edges. The effect looks like a square gradient that stops at the sprite frame boundary.
Example Test Code
// Minimal reproduction
const config = {
type: Phaser.AUTO,
width: 400,
height: 300,
backgroundColor: '#2d2d2d',
scene: {
preload: function () {
// Use any sprite with transparency (non-rectangular shape)
this.load.image('star', 'https://labs.phaser.io/assets/sprites/star.png');
},
create: function () {
const sprite = this.add.sprite(200, 150, 'star');
sprite.enableFilters();
const glow = sprite.filters.internal.addGlow(0xffff00, 4, 0, 1, false, 10, 16);
// BUG: glow is clipped to sprite's rectangular bounds
// WORKAROUND: uncomment the next line to fix it
// glow.setPaddingOverride(null);
}
}
};
new Phaser.Game(config);
Additional Information
Root cause: Controller.js:67 sets this.paddingOverride = new Rectangle(). This zero-valued Rectangle is always truthy, so when Glow.getPadding() checks if (this.paddingOverride), it always takes the override path and returns zero padding instead of calculating distance * scale.
Workaround:
glow.setPaddingOverride(null);
Suggested fix: In Controller.js:67, change:
this.paddingOverride = new Rectangle();
to:
this.paddingOverride = null;
This lets filters with custom getPadding() implementations (Glow, Blur) fall through to their own padding logic by default. setPaddingOverride() can still be called explicitly when an override is desired.
This likely affects any filter that overrides getPadding() with a truthy check on paddingOverride.
- 主要言語
- JavaScript
- スター
- 40.7k
- フォーク
- 7.2k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
phaserjs/phaser のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
メンテナーはふだん 3 日以内に返信
-
Type definition for TilemapLayer.getTileAt is wrong対応中かも @hkbughk が 34 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 3 日以内に返信
-
Shader.preDestroy leaks its ShaderQuad's vertex buffer and VAO on every create/destroy cycle (4.2.1)対応中かも @k1epg01ng129-eng が 32 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
メンテナーはふだん 3 日以内に返信
-
Black opaque background on transparent Phaser.Text textures in Phaser 4.2.1 on older iOS WebGL対応中かも @SamuelMalmfors が 14 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
phaserjs/phaser#7392 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
phaserjs/phaser の issue をすべて見る
似ている issue
-
enhancement ready
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
DCGM/semant-demo#708 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
agents area: runtime automation chore cli consistency dependencies developer-experience difficulty: easy documentation enhancement good first issue help wanted hygiene json-output priority: P3 starters tests
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
Client codegen: an import repeated in an impl file is emitted twice, and the browser rejects the module対応中かも @MalithaPrabhashana が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
jaseci-labs/jac#10756 ·
メンテナーはふだん 1 日以内に返信