Skip to content

getDrawPos() returns wrong height for clipper-basic #80

Closed
@webnautics

Description

@webnautics

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!

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions