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

[Bug] symbolType of svg render result is different with browser #1616

Open
xiaoluoHe opened this issue Dec 17, 2024 · 0 comments
Open

[Bug] symbolType of svg render result is different with browser #1616

xiaoluoHe opened this issue Dec 17, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@xiaoluoHe
Copy link
Contributor

Version

0.21.0

Link to Minimal Reproduction

none

Steps to Reproduce

const symbolList = [
  '<svg t="1733974711438" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1903" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 512m-512 0a512 512 0 1 0 1024 0 512 512 0 1 0-1024 0Z" fill="#19fa28" p-id="1904"></path><path d="M430.08 832s89.28-176.224 191.904-328.672C701.216 385.664 800 282.656 800 282.656L779.392 224s-117.184 83.328-212.064 185.6c-96.32 103.776-170.336 226.688-170.336 226.688L251.52 496.832 192 561.632 430.08 832z" fill="#FFFFFF" p-id="1905"></path></svg>'
];
const graphics = [];

symbolList.forEach((st, i) => {
  const symbol = VRender.createSymbol({
    symbolType: st,
    x: 100,
    y: 100,
    size: 200,
    fill:'red'
    
  });
  symbol.addEventListener('mouseenter', () => {
    symbol.setAttribute('fill', 'blue');
  });
  graphics.push(symbol);
});

const stage = new Stage({
  container: CONTAINER_ID,
  autoRender: true
});

graphics.forEach(g => {
  stage.defaultLayer.add(g);
});

Current Behavior

image

Expected Behavior

与浏览器渲染效果一致

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

@xiaoluoHe xiaoluoHe added the bug Something isn't working label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants