react-native-skia icon indicating copy to clipboard operation
react-native-skia copied to clipboard

Text / Paragraph / Image is not rendering on canvas

Open kokosky93 opened this issue 1 year ago • 5 comments

Description

Hi, sometimes a text is not rendering on canvas at the first time. In such case if I click on an element on which the text should be visible it shows up.

The same situation with images.

It has been happening for me for a long time - this is not a version issue.

I think it is happening mostly if you render something in a list.

Can you please advise?

Version

1.3.10

Steps to reproduce

Look at the code example.

Snack, code example, screenshot, or link to a repository


const customFontMgr = useFonts({
        Regular: [
            require("../../assets/fonts/PlusJakartaSans-Regular.ttf")
        ],
    });

    const dayParagraph = useMemo(() => {
        if (!customFontMgr) {
            return null;
        }

        return Skia.ParagraphBuilder.Make({ textAlign: TextAlign.Center }, customFontMgr)
            .pushStyle({
                color: Skia.Color("#FFFFFF"),
                fontFamilies: ["Regular"],
                fontSize: 15,
            })
            .addText(label)
            .build();
    }, [customFontMgr]);

<Paragraph paragraph={dayParagraph} x={0} y={14} width={width} />

kokosky93 avatar Sep 27 '24 22:09 kokosky93

In such case if I click on an element on which the text should be visible it shows up. I have same bug

dumihi313 avatar Nov 25 '24 08:11 dumihi313

Can you please share a reproducible example? As well as information which platform this happens

wcandillon avatar Dec 04 '24 11:12 wcandillon

I'm having the same problem although I don't know if it is a bug or me not understanding how to use skia properly. Here is a snack to reproduce. This happens on both Android and iOS. On my project I'm using v1.7.6 but this is also reproduced on my snack with v1.5.0 and expo

https://snack.expo.dev/1Os73WHi4LNPz3EnFNlB9?platform=ios

ftanzarella-eviivo avatar Dec 27 '24 09:12 ftanzarella-eviivo

I'm having the same problem although I don't know if it is a bug or me not understanding how to use skia properly. Here is a snack to reproduce. This happens on both Android and iOS. On my project I'm using v1.7.6 but this is also reproduced on my snack with v1.5.0 and expo

https://snack.expo.dev/1Os73WHi4LNPz3EnFNlB9?platform=ios

Fixe my issue by grouping. Please ignore my question.

ftanzarella-eviivo avatar Dec 27 '24 10:12 ftanzarella-eviivo

I've had the same issue, I've seen it on both platforms but it seems to occur more often on Android. I'll see if I can create a minimal repro in the coming days

dentemm avatar Jan 06 '25 13:01 dentemm