nhn / tui.image-editor

🍞🎨 Full-featured photo image editor using canvas. It is really easy, and it comes with great filters.
http://ui.toast.com/tui-image-editor
MIT License
6.94k stars 1.28k forks source link

rotatingPointOffset doesn't work #559

Open paulolafoudre opened 3 years ago

paulolafoudre commented 3 years ago

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 :

Capture d’écran 2021-03-18 à 14 38 31

Nothing in particular appears in console prompt.

Desktop:

Smartphone:

lja1018 commented 3 years ago

@paulolafoudre Thank you for the report. I'll check the cause and solve it ASAP.

darkcris1 commented 3 years ago

I'm also having this issue, does anyone solved it ?

LeakAGeek commented 2 years ago

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.

amarchen commented 1 year ago

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;