LogosDistort icon indicating copy to clipboard operation
LogosDistort copied to clipboard

center point not calculating properly

Open ghost opened this issue 9 years ago • 2 comments

I noticed the effect seemed off when using this, so I used higher than normal values to more prominently show how, if the mouse is placed in the center of the element or window both should essentially show the perspective elements all lined up. but its not, the center point is closer to the top left corner of the window.

If you move the mouse pointer all the way to the left and right side of the window, you will notice it rotates more when the cursor is on the right hand side, that also shows that there is more distance between the center point and the right edge than on the left side, it should be even if the point was in the correct center of the window / element.

I setup a code pen to show the effect. https://codepen.io/oconnalex/pen/xOjpNY/

ghost avatar Jul 25 '16 05:07 ghost

hmm, your right, thanks for the demo. This was a problem I had before, but I thought I got rid of it. Guess not. I'll take a look into this asap.

hellsan631 avatar Jul 25 '16 19:07 hellsan631

I was looking through the code in the jquery.logosDistort.js file trying to figure out a solution and noticed if I removed the '/2' from the following two lines, it works fine.

line 400 return appliedX - (this.center.x/2);

line 404 return appliedY - (this.center.y/2);

Here is a link to a new demo http://demos.alex-oconnell.com/3dimg/demo.html

ghost avatar Jul 25 '16 22:07 ghost