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

无法通过 setAttr 系列方法独立设置文字大小 #1326

Closed
ghost opened this issue Sep 9, 2021 · 3 comments · Fixed by #1397
Closed

无法通过 setAttr 系列方法独立设置文字大小 #1326

ghost opened this issue Sep 9, 2021 · 3 comments · Fixed by #1397
Labels
stale Issue that may be closed soon due to the original author not responding any more. type: bug 缺陷 Defects and unexpected behaviors

Comments

@ghost
Copy link

ghost commented Sep 9, 2021

Expected Behavior

当执行 node.setAttr('label/fontSize', CUSTOM_VAL) 时,文字大小可以发生变化

Current Behavior

只修改文字大小时,文字大小不发生变化

Possible Solution

在设置文字大小时,同时设置一个和之前不同的文字内容

Steps To Reproduce

  1. 打开如下页面:https://x6.antv.vision/zh/examples/node/native-node#rect
  2. 复制下列内容,并替换页面中的代码
import { Graph } from '@antv/x6'

const graph = new Graph({
  container: document.getElementById('container'),
  grid: true,
})

const node = graph.addNode({
  x: 40,
  y: 40,
  width: 120,
  height: 60,
  label: 'rect',
})


node.attr({
  label: { fill: 'blue', fontSize: 16, text: 'my lable' },
})

node.attr({
  label: {fontSize: 28},  
})
// 文字大小没有发生变化

node.attr('label', {
  fontSize: 32, text: 'my lable'
})
// 文字大小没有发生变化

node.attr('label', {
  fontSize: 40, text: 'my new lable'
})
// 当文字内容发生变化时,文字大小才发生变化

Additional Context

Your Environment

  • x6: [1.26.0]
@ghost ghost added the type: bug 缺陷 Defects and unexpected behaviors label Sep 9, 2021
@ghost ghost changed the title 无法独立设置文字大小 无法通过 setAttr 系列方法独立设置文字大小 Sep 9, 2021
@x6-bot
Copy link
Contributor

x6-bot bot commented Sep 30, 2021

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not-stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the AntV community! 💪💯

@x6-bot x6-bot bot added the stale Issue that may be closed soon due to the original author not responding any more. label Sep 30, 2021
@NewByVector NewByVector linked a pull request Oct 2, 2021 that will close this issue
15 tasks
@pipinet
Copy link

pipinet commented Jan 3, 2022

@acev-online
初始化展示的时候是同样的问题,所有的字都是比较大,但是从dom上看到font-size是有的,而且我修改了下源码,强制加上style也都不生效。
The same problem occurs when initializing the display. All the characters are relatively large, but I can see that the font-size is available from the dom, and I modified the source code to force the addition of style to not take effect.

image

@x6-bot
Copy link
Contributor

x6-bot bot commented Jan 4, 2023

This thread has been automatically locked because it has not had recent activity.

Please open a new issue for related bugs and link to relevant comments in this thread.

@x6-bot x6-bot bot locked as resolved and limited conversation to collaborators Jan 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stale Issue that may be closed soon due to the original author not responding any more. type: bug 缺陷 Defects and unexpected behaviors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants