I want to to add custom control(div) to Fabric js object something like this:
I found this question but it has bug on rotation please see jsfiddle
I'm trying to find solution already few days, any suggestions are weled.
I want to to add custom control(div) to Fabric js object something like this:
I found this question but it has bug on rotation please see jsfiddle
I'm trying to find solution already few days, any suggestions are weled.
Share Improve this question edited May 23, 2017 at 12:01 CommunityBot 11 silver badge asked Nov 16, 2015 at 18:17 user525717user525717 1,6525 gold badges28 silver badges40 bronze badges2 Answers
Reset to default 1http://jsfiddle/86bTc/94/
var btnLeft = ((e.target.width / 2) -10 )* cos(angle) + ((e.target.height / 2) +25) * sin(angle);
var btnTop = -((e.target.height / 2) +25 )* cos(angle) + ((e.target.width / 2) -10 ) * sin(angle);
You have to add the rotation effect to LEFT and TOP of your absolute positioned element.
I changed the positioned element with a small div, so you do not get tricked by the baseline of text that makes the 'p' element look in wrong position.
Might be that solution is good for you? Fabric js custom controls
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745350744a4623815.html
评论列表(0条)