MCPcopy Create free account
hub / github.com/PaulleDemon/PyUIBuilder / setTransformWithEvent

Function setTransformWithEvent

src/components/utils/panzoom.js:133–152  ·  view source on GitHub ↗
(
    eventName,
    opts,
    originalEvent
  )

Source from the content-addressed store, hash-verified

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,

Callers 1

panFunction · 0.85

Calls 1

triggerFunction · 0.85

Tested by

no test coverage detected