| 131 | } |
| 132 | |
| 133 | function setTransformWithEvent( |
| 134 | eventName, |
| 135 | opts, |
| 136 | originalEvent |
| 137 | ) { |
| 138 | const value = { x, y, scale, isSVG, originalEvent } |
| 139 | requestAnimationFrame(() => { |
| 140 | if (typeof opts.animate === 'boolean') { |
| 141 | if (opts.animate) { |
| 142 | setTransition(elem, opts) |
| 143 | } else { |
| 144 | setStyle(elem, 'transition', 'none') |
| 145 | } |
| 146 | } |
| 147 | opts.setTransform(elem, value, opts) |
| 148 | trigger(eventName, value, opts) |
| 149 | trigger('panzoomchange', value, opts) |
| 150 | }) |
| 151 | return value |
| 152 | } |
| 153 | |
| 154 | function constrainXY( |
| 155 | toX, |