{"action":"created","issue":{"url":"https://api.github.com/repos/timmywil/jquery.panzoom/issues/273","repository_url":"https://api.github.com/repos/timmywil/jquery.panzoom","labels_url":"https://api.github.com/repos/timmywil/jquery.panzoom/issues/273/labels{/name}","comments_url":"https://api.github.com/repos/timmywil/jquery.panzoom/issues/273/comments","events_url":"https://api.github.com/repos/timmywil/jquery.panzoom/issues/273/events","html_url":"https://github.com/timmywil/jquery.panzoom/issues/273","id":174847904,"number":273,"title":"Basic panzoom use case, but having an issue making sense of the results","user":{"login":"kgraves","id":855798,"avatar_url":"https://avatars.githubusercontent.com/u/855798?v=3","gravatar_id":"","url":"https://api.github.com/users/kgraves","html_url":"https://github.com/kgraves","followers_url":"https://api.github.com/users/kgraves/followers","following_url":"https://api.github.com/users/kgraves/following{/other_user}","gists_url":"https://api.github.com/users/kgraves/gists{/gist_id}","starred_url":"https://api.github.com/users/kgraves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kgraves/subscriptions","organizations_url":"https://api.github.com/users/kgraves/orgs","repos_url":"https://api.github.com/users/kgraves/repos","events_url":"https://api.github.com/users/kgraves/events{/privacy}","received_events_url":"https://api.github.com/users/kgraves/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-02T21:06:52Z","updated_at":"2016-09-07T17:48:53Z","closed_at":null,"body":"First off just wanted to thanks the contributors and author for this, it's a great tool, and I'm glad it exists! :+1: \r\n\r\n### Subject of the issue\r\nI've setup a [jsfiddle](https://jsfiddle.net/kgraves/pjxwLtm8/) to demonstrate my issue.\r\n\r\nI'm building a system where I have data like the following:\r\n\r\n```javascript\r\n[\r\n  {\r\n    x: 200,\r\n    y: 200,\r\n    zoomFactor: 1.2\r\n  },\r\n  ...\r\n]\r\n```\r\n\r\nBased on certain user input, I need to pan and zoom the image to the above defined points. (pretty basic) However, I'm having some weird behavior that I'm not entirely understanding.\r\n\r\nThe pan and zoom features of the library seem to affect each other in odd ways. I'll describe in detail in the \"Steps to reproduce\" section. This is issue makes me feel like I'm missing something big about this library, but I don't see anyone talking about the issue I'm having nor any example to account for this.\r\n\r\nAny pointers, advice, or examples are much appreciated!\r\n\r\n### My environment\r\n* jquery == 3.1.0\r\n* jquery.panzoom == 3.2.2\r\n* chrome == 52.0.2743.116\r\n* ubuntu == 16.04\r\n\r\n### Steps to reproduce\r\n1) open the above jsfiddle\r\n2) open dev tools for info logged to the console\r\n3) click the 'Details' button in the demo\r\n4) notice that the position of the image is logged to the console. Currently it's at (0, 0).\r\n5) click the 'Pan' button, then again click the 'Details' button\r\n6) notice that the image was moved to (200, 200), where we want it.\r\n7) now click the 'Zoom' button, and again click the details button\r\n8) notice that the image has moved from (200, 200) and is now at (208, 244)\r\n**NOTE** This same issue happens when zooming first, then panning, although the coordinates differ.\r\n\r\n### Expected behaviour\r\nI naively expect that the image will be zoomed to the given zoomFactor AND the image should stay where I've panned it to, namely (200, 200).\r\n\r\n### Actual behaviour\r\nWhen zooming the image pans away from the previously set coordinates\r\n"},"comment":{"url":"https://api.github.com/repos/timmywil/jquery.panzoom/issues/comments/245362071","html_url":"https://github.com/timmywil/jquery.panzoom/issues/273#issuecomment-245362071","issue_url":"https://api.github.com/repos/timmywil/jquery.panzoom/issues/273","id":245362071,"user":{"login":"kgraves","id":855798,"avatar_url":"https://avatars.githubusercontent.com/u/855798?v=3","gravatar_id":"","url":"https://api.github.com/users/kgraves","html_url":"https://github.com/kgraves","followers_url":"https://api.github.com/users/kgraves/followers","following_url":"https://api.github.com/users/kgraves/following{/other_user}","gists_url":"https://api.github.com/users/kgraves/gists{/gist_id}","starred_url":"https://api.github.com/users/kgraves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kgraves/subscriptions","organizations_url":"https://api.github.com/users/kgraves/orgs","repos_url":"https://api.github.com/users/kgraves/repos","events_url":"https://api.github.com/users/kgraves/events{/privacy}","received_events_url":"https://api.github.com/users/kgraves/received_events","type":"User","site_admin":false},"created_at":"2016-09-07T17:48:53Z","updated_at":"2016-09-07T17:48:53Z","body":"I've been playing with this for the past few days, and am going through the source to try to debug further, or at least understand the results.\r\n\r\nI've also found that the problem is exacerbated when the zoom factor is higher. So for instance, in the above jsfiddle, when the zoom factor is 5, and you first zoom, then pan, I would expect the image to be at `(200, 200)` since the last operation was panning. However, the image ends up at (-1346, -1000)... wat\r\n\r\n\r\nHas anyone else experienced this behavior, or have any advice on how to mitigate/solve this issue?"}}
{"actor":{"display_login":"kgraves"}}