Created
March 14, 2021 12:35
-
-
Save xsrf/f7d10fd18c0be5cb1bb34ab7ef683716 to your computer and use it in GitHub Desktop.
EasyEDA Reset NetPort Mark alignment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Reset NetPort Mark alignment (select Ports first) | |
api('getSelectedIds').split(',').forEach((k)=>{ | |
netflag = api('getShape',{id: k}); | |
if(netflag && netflag.mark && netflag.configure) { | |
netflag.mark.x = Number(netflag.configure.x) + (23 * (netflag.configure.rotation == 0 ? -1:1)); | |
netflag.mark.y = Number(netflag.configure.y) + 3.5; | |
netflag.mark.textAnchor = (netflag.configure.rotation == 0) ? 'end' : 'start'; | |
netflag.gId = netflag.configure.gId; | |
api('updateShape',{ shapeType:'netflag', "jsonCache": netflag }); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment