libpag icon indicating copy to clipboard operation
libpag copied to clipboard

`pagFile.replaceText` with `fillColor` not working, text always black

Open johncalvinroberts opened this issue 9 months ago • 1 comments

你好!非常感谢你们的很好的库。我上次提 #2702, 谢谢你们的答复啊。这次更新4.4.x后遇到了一些新的问题 如下:

Which Version of libpag are you using?

libpag 4.4.25

What Platform are you on?

Web

Expected Behavior

Calling replaceText on a loaded pagfile after setting fillColor on a textData should properly set the color of the text data.

Like this:

Image

Actual Behavior

The rendered text is always black, ignoring the fillColor set on the `textData.

Image

Code Example

Bug repro can be found in this repo: https://github.com/johncalvinroberts/libpag-text-test

Specifically:

					const textData = pagFile.getTextData(i);
					textData.fillColor = { red: 255, green: 255, blue: 0 };
					textData.text = "REPLACE";
					pagFile.replaceText(i, textData);

Upload the pag file below to show the bug -- text is always black.

PAG File

bad_pag_file_with_text.pag.zip

johncalvinroberts avatar Mar 05 '25 22:03 johncalvinroberts

可以基于 pag 的官方 demo 做下测试,https://github.com/libpag/pag-web.git 试了下最新的 4.4.29 版本是没有问题的,如果有更进一步的信息,欢迎反馈给我们

kevingpqi123 avatar Apr 30 '25 08:04 kevingpqi123