-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: stroke rendering on Graphics when width is set to 0 (#10496)
* couple of tweaks to not render stroke if stoke width is 0 * Update tests/visual/scenes/text/text-stroke.scene.ts Co-authored-by: Matt Karl <matt@mattkarl.com> * lint * fix test --------- Co-authored-by: Matt Karl <matt@mattkarl.com>
- Loading branch information
1 parent
caab673
commit 75bcada
Showing
6 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { Graphics } from '../../../../src/scene/graphics/shared/Graphics'; | ||
import { Text } from '../../../../src/scene/text/Text'; | ||
import { TextStyle } from '../../../../src/scene/text/TextStyle'; | ||
|
||
import type { Container } from '../../../../src/scene/container/Container'; | ||
import type { TestScene } from '../../types'; | ||
|
||
export const scene: TestScene = { | ||
it: 'should render text stroke if it has a width greater than one', | ||
pixelMatch: 10, | ||
create: async (scene: Container) => | ||
{ | ||
const style = new TextStyle({ | ||
fontFamily: 'Arial', | ||
fontWeight: 'bold', | ||
fontStyle: 'normal', | ||
fontSize: 36, | ||
fill: 0xFFFFFF, | ||
stroke: { | ||
color: 0x000000, | ||
width: 0, | ||
}, | ||
align: 'center', | ||
wordWrap: true, | ||
wordWrapWidth: 200, | ||
breakWords: true, | ||
}); | ||
|
||
const text = new Text({ | ||
text: 'PixiJS is very cool indeed', | ||
style | ||
}); | ||
|
||
const whiteBox = new Graphics().rect(0, 0, 128, 128).fill(0xFFFFFF); | ||
|
||
scene.addChild(whiteBox); | ||
scene.addChild(text); | ||
|
||
// This SHOULD result in a totally white texture :) | ||
}, | ||
}; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.