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

rotationPoint option #56

Closed
frenchcdsl44 opened this issue Nov 30, 2021 · 6 comments
Closed

rotationPoint option #56

frenchcdsl44 opened this issue Nov 30, 2021 · 6 comments

Comments

@frenchcdsl44
Copy link

Hi

Sorry to bother you again.

You did not specify on the readme the rotationPoint option.
I tried to put a boolean and it works fine I can drag the rotation center.

I also tried
rotationPoint: [200, 200],
but it does not seem to change the position of this point.

Is there anyway to move this point in the init function ? Maybe by adding parameters to the function resetCenterPoint?

Thanks I am already greatly impressed by the possibilities enabled by subjx.

@nichollascarter
Copy link
Owner

nichollascarter commented Nov 30, 2021

hi @frenchcdsl44

Yeah, you are right, i did not specify rotationPoint option, because it is an experimental option.

rotationPoint: [200, 200],

If you want set initial position you need to use staging version.
Please take a look to this example.

I will add it to stable version when it will be tested well.

Please let me know if you will have any troubles with lib usage.

@frenchcdsl44
Copy link
Author

Hi

I think defining the rotation point in a callback method could be useful.
I made a quick patch #57 that I tested in my very limited use case.
I am so far more of a jquery user than a real es6 developer, but I am willing to learn so don't hesitate to tell me if I can help.

Thanks

@nichollascarter
Copy link
Owner

nichollascarter commented Dec 1, 2021

Thanks for PR

Probably it is better to add new method called like setCenterPoint, because reset word could be confusing.

@nichollascarter
Copy link
Owner

@frenchcdsl44 ,

i prepared PR ^ with your proposed functionality, please take a look and let me know if you will have any thoughts

@frenchcdsl44
Copy link
Author

It looks excellent. I have my kids this week, but I try to test this as soon as possible

Thank you Santa Clauscarter

@frenchcdsl44
Copy link
Author

Hi @nichollascarter

Sorry for the late feedback.

This is truly amazing.

I tried absolute positioning
this.setCenterPoint({x:10, y:20},true);
I tried relative positioning
this.setCenterPoint({dx:10, dy:20},false);
I tried it in inInit and onDrop.

It work very well.

Congratulations and 2022 thanks.

I'll try to make my svg puppet now and post you a link when done

nichollascarter pushed a commit that referenced this issue Feb 13, 2022
# [1.1.0-rc.1](v1.0.0...v1.1.0-rc.1) (2022-02-13)

### Features

* **src:** add setCenterPoint method ([7995cf5](7995cf5)), closes [#56](#56)
* added transform origin support ([75e33de](75e33de))
nichollascarter pushed a commit that referenced this issue Jul 4, 2022
# [1.1.0](v1.0.0...v1.1.0) (2022-07-04)

### Bug Fixes

* fix wrong transform-origin position for nested elements ([93af678](93af678))
* **core:** fixed tests ([5d81abe](5d81abe))
* **src:** fixed undefined containerMatrix value on applying alignment ([6b20349](6b20349))
* **core:** set correct transform origin, allow alignment for groupable html elements ([cf29d29](cf29d29))

### Features

* **src:** add setCenterPoint method ([7995cf5](7995cf5)), closes [#56](#56)
* added transform origin support ([75e33de](75e33de))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants