javascript - Add custom control to Fabricjs object - Stack Overflow

I want to to add custom control(div) to Fabric js object something like this:I found this question but

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 badges
Add a ment  | 

2 Answers 2

Reset to default 1

http://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

相关推荐

  • javascript - Add custom control to Fabricjs object - Stack Overflow

    I want to to add custom control(div) to Fabric js object something like this:I found this question but

    3小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信