You need to use EasyEDA editor to create some projects before publishing
Rotation center point
750 4
evgeny.zislis 5 years ago
I am trying to rotate selected circle of objects by 30 degrees using the API. My code looks like this - ``` var ids = api('getSelectedIds').split(','); api('rotate', {ids:ids, degree:30}); ``` The problem is that each object rotates around its own center. But I really need to rotate all of the selected objects around a common center. At the moment all the objects have 0,0 as the origin, so but it doesn't really help - rotating a circle by 30deg moves its center away from where it previously was.
Comments
evgeny.zislis 5 years ago
Ended up moving the objects a fixed adjustment after the rotation. ``` var objs = []; for (i=0; i
Reply
evgeny.zislis 5 years ago
``` var objs = []; for (i=0; i
Reply
evgeny.zislis 5 years ago
``` var objs = []; for (i=0; i\
Reply
evgeny.zislis 5 years ago
``` var objs = []; for (i=0; i<ids.length; i++) {   objs.push({gId: ids[i]}); } api('moveObjs', {objs:objs, addX: -6.637782, addY: -5.153533}); ``` And the JavaScript `map` function does not work, which is why I had to use a loop.
Reply
Login or Register to add a comment
goToTop
你现在访问的是EasyEDA海外版,使用建立访问速度更快的国内版 https://lceda.cn(需要重新注册)
如果需要转移工程请在个人中心 - 工程 - 工程高级设置 - 下载工程,下载后在https://lceda.cn/editor 打开保存即可。
有问题联系QQ 3001956291 不再提醒
svg-battery svg-battery-wifi svg-books svg-more svg-paste svg-pencil svg-plant svg-ruler svg-share svg-user svg-logo-cn svg-double-arrow -mockplus- -mockplus- -mockplus- -mockplus- -mockplus- -mockplus- -mockplus- -mockplus-@1x -mockplus-

Cookie Notice

Our website uses essential cookies to help us ensure that it is working as expected, and uses optional analytics cookies to offer you a better browsing experience. To find out more, read our Cookie Notice