dotherightthing / focalpoint-multi-cropper

Add a focalpoint to an image and generate project-specific crops.
0 stars 0 forks source link

CrCroppersUi.initDelay is a bandaid #15

Closed dotherightthing closed 1 year ago

dotherightthing commented 1 year ago

initDelay prevents an error caused by displayFocalpoint firing before the cropper has been injected.

This error would be caused by:

resetFocalpoint > displayFocalpoint > calcPageXYFromImageXY > calcCanvasOffsets > getOffset

A better solution may be to add an observer to determine that the cropper has actually been injected.

Unless cropperjs has a callback?