()
| 120 | |
| 121 | // Align object |
| 122 | function alignObject() { |
| 123 | const type = $(this).attr('id'); |
| 124 | const object = canvas.getActiveObject(); |
| 125 | console.log(canvas.getActiveObject().type); |
| 126 | if (canvas.getActiveObject().type == 'activeSelection') { |
| 127 | const tempselection = canvas.getActiveObject(); |
| 128 | canvas.discardActiveObject(); |
| 129 | tempselection._objects.forEach(function (object) { |
| 130 | alignControls(object, type); |
| 131 | canvas.renderAll(); |
| 132 | newKeyframe( |
| 133 | 'left', |
| 134 | object, |
| 135 | currenttime, |
| 136 | object.get('left'), |
| 137 | true |
| 138 | ); |
| 139 | newKeyframe( |
| 140 | 'top', |
| 141 | object, |
| 142 | currenttime, |
| 143 | object.get('top'), |
| 144 | true |
| 145 | ); |
| 146 | }); |
| 147 | reselect(tempselection); |
| 148 | } else { |
| 149 | alignControls(object, type); |
| 150 | canvas.renderAll(); |
| 151 | newKeyframe( |
| 152 | 'left', |
| 153 | object, |
| 154 | currenttime, |
| 155 | object.get('left'), |
| 156 | true |
| 157 | ); |
| 158 | newKeyframe('top', object, currenttime, object.get('top'), true); |
| 159 | } |
| 160 | } |
| 161 | $(document).on('click', '.align', alignObject); |
| 162 | |
| 163 | // Alignment guides |
nothing calls this directly
no test coverage detected