-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
SVG not rendering with other graphics #7220
Comments
Seems like a CORS issue:
|
@bigtimebuddy that's really odd. It worked approximately 1hr before when I was using the icon for preliminary tests in the playground. I'll double check that. |
@bigtimebuddy I've configured it to access 3 different svgs from different urls. One of which is in an S3 bucket I created that should be public. I'm able to access the bucket from incognito. For the "mail-6" svg network requests (one to the source, and one to where I placed it in the S3 bucket), I'm not seeing a header specifying the request method. This is the line (134) that should be making the request to create the texture: var svgtexture = PIXI.Texture.from(config.icon); where config.icon is the url. I tried PIXI.Texture.fromURL as well, but that failed too. |
To help troubleshoot this, is there an svg on the pixijs domain that could be tried? It just seems weird that the svg from the public s3 bucket failed too. |
Try this: |
excellent, i'll take a look |
No errors in the network request to the dropbox based svg, but I'm not seeing the SVG rendered. I'm still investigating as well, but wanted to give you a heads up. |
@bigtimebuddy I updated the playground (https://www.pixiplayground.com/#/edit/fRNuBBozMAjOIqTYgnRbj) with as little code as required to replicate the issue. I have included 2 lines (40 and 41) to switch that demonstrate the proper render vs the failure:
It appears that the issue appears when the svg is run through BaseRenderTexture and RenderTexture. Does this have to do with a loading time for the SVG? |
Yes, loading any assets is an asynchronous process and the image is not available when you create the RenderTexture. I would suggest that you use |
bingo, thanks @bigtimebuddy |
Expected Behavior
svg icon should display to the left of the text
Current Behavior
text and other graphics appear, but the SVG does not
Possible Solution
honestly I don't know. It's possible I've made a mistake and this isn't a bug. SVGs render normally when I'm not converting them to a texture.
Steps to Reproduce
running in the playground: https://www.pixiplayground.com/#/edit/fRNuBBozMAjOIqTYgnRbj
Environment
Windows 10, edge Version 88.0.705.56 (Official build) (64-bit)
pixi.js
version: 5.3.7The text was updated successfully, but these errors were encountered: