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

使用vue-picture-bd-marker的图片展示严重比例失调问题 #3

Closed
huicrh opened this issue Oct 22, 2019 · 7 comments
Closed

Comments

@huicrh
Copy link

huicrh commented Oct 22, 2019

展示的图片heigh一直为781.313px,宽度为100%。造成图片的缩放比例与原图片不符合,图片变形。

@sunshengfei
Copy link
Owner

宽度目前还不支持百分比,必须是px

@huicrh
Copy link
Author

huicrh commented Oct 23, 2019

比如我图片原始宽高是540540,采用插件设置了imgUrl到界面是1222781。比例和原图片差别太大。能否设置展示图片的宽高为1:1呢,ratio属性不能达到这种效果

@huicrh
Copy link
Author

huicrh commented Oct 23, 2019

比如我图片原始宽高是540乘以540,采用插件设置了imgUrl到界面是1222乘以781

@sunshengfei
Copy link
Owner

ok,我记录下,今天抽空解决下

@sunshengfei
Copy link
Owner

你好,此问题预计下个版本会优化,但目前手上几个事情还比较紧急,所以给你提供临时解决方案,如下:

<ui-marker  ref="aiPanel-editor" :ratio="ratio"  @vmarker:onImageLoad="onImageLoad" >
</ui-marker>
``
在onImageLoad方法中再次更改ratio的值即可。

@huicrh
Copy link
Author

huicrh commented Oct 25, 2019

你好,感谢给出解决方案。已解决该问题。
1.ratio必须配合width才能生效,而且ratio值是"16/9"也不对,必须是一个Number类型,不能是字符串。这样看来技术文档好像有点问题。
2.用了该解决方案确实能解决图片缩放的问题,但是对于移动标注矩形框还会有问题。具体表现为横向拖动和纵向拖动相同距离,框的移动距离是不同的。

@sunshengfei
Copy link
Owner

sunshengfei commented Oct 25, 2019 via email

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

2 participants