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

[Feature request/新需求] #354

Open
HuiFeiYa opened this issue Jun 27, 2021 · 0 comments
Open

[Feature request/新需求] #354

HuiFeiYa opened this issue Jun 27, 2021 · 0 comments

Comments

@HuiFeiYa
Copy link
Contributor

您的Feature Request/想法是否与已有问题有关? 请描述。
给组件通用样式的宽高添加单位选择: px% 。在布局的时候<Shape> 组件层默认的宽度是 px 为单位。很多时候宽度并不是写死的。例如中间放了张图宽度 100% 的需求。

简述你想要的解决方案

  1. models/element.js 类中的添加 widthUnitheightUnitgetStyle 方法中根据单位动态返回样式。
  2. support/shape.js
    • 计算 point 的 topleft 时候也使用加上单位。
    • mousedownForMark 函数中计算当前移动的距离,换算成对应屏幕的宽高的百分比更新到 pos.widthpos.height 中。

但是之前的组件拖动时候会出现抖动,向右方向拉伸组件的编辑框等操作会导致抖动。 #351,需要先将该 bug 修复下。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant