[英]Fabric js canvas border affects mouse offset
Using Fabric JS, I have a 100px border as an inline style for my canvas 使用Fabric JS,我有一个100px的边框作为画布的嵌入式样式
<canvas id='c' style = 'border: solid red 100px;'></canvas>
This is causing issues with selecting objects as the mouse position seems to be offset by the border width 这导致选择对象时出现问题,因为鼠标位置似乎被边框宽度偏移
I have tried to fix the issue using 我尝试使用解决问题
obj.setCoords();
and 和
canvas.calcOffset();
with no joy?.. 没有喜悦?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.