-
Notifications
You must be signed in to change notification settings - Fork 32
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
getDrawPos() returns wrong height for clipper-basic #80
Comments
Hi @webnautics , |
Hi @timtnleeProject |
Hi @webnautics , I might need some time to fix this. |
Thanks a lot, appreciate it! |
Hi @webnautics , However, I found that it is difficulty to get both precision and the ability of responsive layout.
|
@timtnleeProject Thank you! Have a good time! |
I'm using
<clipper-basic ref="clipper" class="clipper" :src="item.preview_url" :ratio="ratio" :init-height="initHeight" :init-width="initWidth"></clipper-basic>
Width these values:
item.preview_url - image 1024 * 768 px (for sure!), jpg
ratio - 4/3 (float value)
initHeight - 100
initWidth - 100
When I'm reading this.$refs.clipper.getDrawPos(), I get for
pos.dheight: 769.3001449611606 or 769.3449676382747, ..., it varies..
pos.dwidth: 1024 - always correct!
It results in 1px more on top of the image in return by using:
const canvas = this.$refs.clipper.clip();
return canvas.toDataURL("image/jpeg");
Is there anything wrong on my side?
Thanks for help!
The text was updated successfully, but these errors were encountered: