tui.image-editor
tui.image-editor copied to clipboard
rotatingPointOffset doesn't work
Describe the bug I am using "tui-image-editor": "^3.11.0" and during the creation of a new tui Instance, i give this as selectionStyle :
-
white is good
-
cornerSize is good
-
rotatingPointOffset is ignored (i tried 5, 100, 1000 nothing has changed in the view)
Nothing in particular appears in console prompt.
Desktop:
- OS: macOS11.2
- Browser chrome
- Version 89
Smartphone:
- Device: iPhone XR
- OS: iOS14
- Browser Safari
- Version 14
@paulolafoudre Thank you for the report. I'll check the cause and solve it ASAP.
I'm also having this issue, does anyone solved it ?
RotatingPointOffset was removed in fabric.js version 4. Instead, a parameter offsetY was introduced on the controls. This needs to be modified with:
window.fabric.Object.prototype.controls. mtr.offsetY = [offsetValue]
These controls are initialized with default values at deployment of fabric. mtr is the "middle top rotating point"
RotatingPointOffset as config parameter of objects doesn't exist anymore in fabric.
As a workaround I am using something similar to @LeakAGeek 's solution, but outside from editor (so I can use it as an untouched npm library) and for each individual object separately (my particular use case is superfast image watermarking without the need to upload files and I anyway support one textualwatermark only at the moment):
const imageEditor = new ImageEditor('.tui-image-editor', {
...
imageEditor.loadImageFromFile(file).then(() => {
...
imageEditor._graphics.getObject(id_of_the_obj_i_am_interested_in).controls.mtr.offsetY = -goodRotatingPointOffsetValue;