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] can't update opacity of richtext #1578

Open
xile611 opened this issue Nov 27, 2024 · 0 comments
Open

[Bug] can't update opacity of richtext #1578

xile611 opened this issue Nov 27, 2024 · 0 comments
Assignees
Labels
bug Something isn't working high priority

Comments

@xile611
Copy link
Contributor

xile611 commented Nov 27, 2024

VisActor/VChart#3465

Version

no

Link to Minimal Reproduction

no

Steps to Reproduce

const graphics = [];
const rich = VRender.createRichText({
    x: 0,
    y: 0,
    width: 300,
    height: 0,
    textConfig: [
      {
        text: '即将发布的',
        fill: '#000',
        fontSize: 16,
        textDecoration: 'line-through'
      },
      {
        text: 'VisActor',
        fontWeight: 'bold',
        fontSize: 30,
        fill: '#0013e6'
      },
      {
        text: '由数据而生,演绎数据之美。致力于成为面向叙事的智能可视化解决方案。截至目前,',
        fill: '#000',
        fontSize: 16,
        lineHeight: 26
      },
      {
        text: 'VisActor',
        fontStyle: 'italic',
        fill: '#000',
        fontSize: 16,
        lineHeight: 26,
        textDecoration: 'underline'
      },
      {
        text: '已经开源了多个可视化模块,它们分别是\n',
        fill: '#000',
        fontSize: 16,
        lineHeight: 26
      },
      {
        text: 'VChart 故事讲述者',
        fill: '#3f51b5',
        fontSize: 16,
        lineHeight: 26,
        fontWeight: 'bold'
      },
      {
        text: '[1]',
        script: 'super',
        fill: '#000',
        fontSize: 16,
        lineHeight: 26,
        fontWeight: 'bold'
      },
      {
        text: '。它不只是开箱即用的多端图表库,更是生动灵活的数据故事讲述者。\n',
        fill: '#000',
        fontSize: 16,
        lineHeight: 26
      },
      {
        text: 'VTable 方格艺术家',
        fill: '#3f51b5',
        fontSize: 16,
        lineHeight: 26,
        fontWeight: 'bold'
      },
      {
        text: '[2]',
        script: 'super',
        fill: '#000',
        fontSize: 16,
        lineHeight: 26,
        fontWeight: 'bold'
      },
      {
        text: '。它不只是一款高性能的多维数据分析表格,更是一个在行列间创作的方格艺术家。\n',
        fill: '#000',
        fontSize: 16,
        lineHeight: 26
      },
      {
        text: 'VGrammar 数据魔法师',
        fill: '#3f51b5',
        fontSize: 16,
        lineHeight: 26,
        fontWeight: 'bold'
      },
      {
        text: '[3]',
        script: 'super',
        fill: '#000',
        fontSize: 16,
        lineHeight: 26,
        fontWeight: 'bold'
      },
      {
        text: '。不只是生成万千图表的可视化语法,更是化枯燥为神奇的数据魔法师。\n',
        fill: '#000',
        fontSize: 16,
        lineHeight: 26
      },
      {
        text: 'VRender 可视化渲染',
        fill: '#3f51b5',
        fontSize: 16,
        lineHeight: 26,
        fontWeight: 'bold'
      },
      {
        text: '[4]',
        script: 'super',
        fill: '#000',
        fontSize: 16,
        lineHeight: 26,
        fontWeight: 'bold'
      },
      {
        text: '。不只是一个功能丰富的可视化渲染擎,更是一支得心应手的生花妙笔。',
        fill: '#000',
        fontSize: 16,
        lineHeight: 26
      }
    ],
    opacity: 1
  });
graphics.push(
  rich
);
const stage = new Stage({
  container: CONTAINER_ID,
  autoRender: true
});

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

rich.setAttributes({ opacity: 0.2 })
stage.render();

window.stage = stage;

Current Behavior

更新richtext的opacity 不生效

image

Expected Behavior

更新richtext的opacity 能够正常生效

image

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

@xile611 xile611 added the bug Something isn't working label Nov 27, 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 high priority
Projects
None yet
Development

No branches or pull requests

2 participants