Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rotatingPointOffset doesn't work #559

Open
paulolafoudre opened this issue Mar 18, 2021 · 4 comments
Open

rotatingPointOffset doesn't work #559

paulolafoudre opened this issue Mar 18, 2021 · 4 comments
Labels

Comments

@paulolafoudre
Copy link

paulolafoudre commented Mar 18, 2021

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

  • 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
@lja1018
Copy link
Contributor

lja1018 commented Mar 19, 2021

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

@darkcris1
Copy link

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

@LeakAGeek
Copy link
Contributor

LeakAGeek commented Aug 5, 2022

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.

LeakAGeek pushed a commit to LeakAGeek/tui.image-editor that referenced this issue Aug 6, 2022
@amarchen
Copy link

amarchen commented Dec 4, 2022

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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants