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

added new origin factor feature #18

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

itaysmalia
Copy link

@itaysmalia itaysmalia commented Oct 10, 2020

origin factor feature

Had an idea for adding a customisable origin factor feature.

the idea is very simple, by default, the tilt origin is from center, I needed a different origin, maybe from bottom, or the left side or maybe somewhere between center and top, so I created a solution for this problem.
I added two options: XOrigin (default 0) and YOrigin (default 0).
the range for both is from -1 to 1, -1 is the very start of the axis and 1 is the end of the axis, of course the default (0) is the center of the axis.
usage:

<Tilt options={{ XOrigin: -1, YOrigin: -1 }}>
    this origin will be from top left corner
</Tilt>

(by the way i dont now how to delete the package-lock.json file from the commits so you can just delete it)

// Events
this.onMouseEnter = this.onMouseEnter.bind(this, this.props.onMouseEnter);
this.onMouseMove = this.onMouseMove.bind(this, this.props.onMouseMove);
this.onMouseLeave = this.onMouseLeave.bind(this, this.props.onMouseLeave);
}
componentDidMount() {
this.element = findDOMNode(this);
const myNode = this.getDOMNode();
const myNode = this.element
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed it because it is causing the build to fail

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

Successfully merging this pull request may close these issues.

1 participant