Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support alpha colors with Text stroke #10800

Merged
merged 8 commits into from
Jul 29, 2024
Merged

Conversation

bigtimebuddy
Copy link
Member

@bigtimebuddy bigtimebuddy commented Jul 28, 2024

Fixes #10798

This fixes support on stroke for both #RRGGBBAA colors and alpha property uses.

Broken (v8.2.5)

Screenshot 2024-07-27 at 9 33 01 PM

https://jsfiddle.net/bigtimebuddy/gy7dw8mh/

{
  color: '#ff000080',
  width: 10,
}

https://jsfiddle.net/bigtimebuddy/gw2vbnc7/

{
  color: '#ff0000',
  alpha: 0.5,
  width: 10,
}

Fixed (PR)

Screenshot 2024-07-27 at 9 32 41 PM

https://jsfiddle.net/bigtimebuddy/b6uztmjd/

{
  color: '#ff000080',
  width: 10,
}

https://jsfiddle.net/bigtimebuddy/t3h476x8/

{
  color: '#ff0000',
  alpha: 0.5,
  width: 10,
}

dev7355608 and others added 6 commits July 16, 2024 15:12
* feat: add ShaderSystem#maxTextures

* use gpu.device.limits.maxSampledTexturesPerShaderStage

---------

Co-authored-by: Zyie <24736175+Zyie@users.noreply.github.com>
* feat: reserve texture units for batching

* maxTextures instead of reservedTextures

---------

Co-authored-by: Zyie <24736175+Zyie@users.noreply.github.com>
* feat: add 'min' and 'max' blend modes

* Add visual tests

* Fix variable name

* replace webgl2 test

---------

Co-authored-by: Zyie <24736175+Zyie@users.noreply.github.com>
* add a renderable GC

* lint

* oops

* fix nineslice destroy

* fix up PR

* tweak times for tests

* Update package.json

* remove unneeded extension.add call in TextureGCSystem and RenderableGCSystem

---------

Co-authored-by: Zyie <24736175+Zyie@users.noreply.github.com>
Copy link

codesandbox-ci bot commented Jul 28, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 5dcd748:

Sandbox Source
pixi.js-sandbox Configuration

@bigtimebuddy bigtimebuddy changed the title feat: Support alpha colors with stroke and fill feat: Support alpha colors with Text stroke Jul 28, 2024
@Zyie Zyie added the ✅ Ready To Merge Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t label Jul 29, 2024
@Zyie Zyie force-pushed the dev branch 2 times, most recently from 9c9b4eb to 23656bd Compare July 29, 2024 08:11
@Zyie Zyie added this pull request to the merge queue Jul 29, 2024
Merged via the queue into dev with commit 2d55b40 Jul 29, 2024
5 checks passed
@Zyie Zyie deleted the feature/fill-stroke-alpha branch July 29, 2024 08:31
@@ -14,7 +14,7 @@ export function getCanvasFillStyle(
{
if (fillStyle.texture === Texture.WHITE && !fillStyle.fill)
{
return Color.shared.setValue(fillStyle.color).toHex();
return Color.shared.setValue(fillStyle.color).setAlpha(fillStyle.alpha ?? 1).toHexa();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From types, If there is HEXA fillStyle.color but no fillStyle.alpha, isn't opacity always will be 1?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✅ Ready To Merge Helpful when issues are in the queue waiting to get merged. This means the PR is completed and has t
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Text stroke alpha doesn't work
5 participants