javascript - Adding sizing handles to drawn object in canvas - Stack Overflow

I have a full screen canvas I am drawing to, and I've set it up to allow the user to drag and drop

I have a full screen canvas I am drawing to, and I've set it up to allow the user to drag and drop objects that are within the canvas.

I also want to enable them to select an object, and then 'resize handlers' show up (the little circles in the corners) to allow them to click/drag and resize them.

I can code this manually by drawing circles in each corner and detect a click, etc.... but was wondering if anyone has any better way to do this? Maybe there's a library out there that already handles this?

Any help is appreciated!

I have a full screen canvas I am drawing to, and I've set it up to allow the user to drag and drop objects that are within the canvas.

I also want to enable them to select an object, and then 'resize handlers' show up (the little circles in the corners) to allow them to click/drag and resize them.

I can code this manually by drawing circles in each corner and detect a click, etc.... but was wondering if anyone has any better way to do this? Maybe there's a library out there that already handles this?

Any help is appreciated!

Share Improve this question asked Apr 4, 2011 at 5:48 SteveSteve 2,1485 gold badges25 silver badges36 bronze badges 2
  • 1 Have you seen fabric.js? – kangax Commented Apr 5, 2011 at 22:21
  • Kangax - thanks a ton, your library is perfect and is very very impressive. I was thinking of building something similar, but looks like you've already done it. Instead, I filed a bug, and maybe I'll find a way to contribute :) – Steve Commented Apr 8, 2011 at 8:03
Add a ment  | 

1 Answer 1

Reset to default 8

There isn't any simpler way than doing it yourself or getting a library to do it for you.

I wrote a tutorial here on the use of sizing handles. That should get you started if you plan to make your own.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745314061a4622134.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

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

关注微信