{"action":"created","issue":{"url":"https://api.github.com/repos/paperjs/paper.js/issues/845","labels_url":"https://api.github.com/repos/paperjs/paper.js/issues/845/labels{/name}","comments_url":"https://api.github.com/repos/paperjs/paper.js/issues/845/comments","events_url":"https://api.github.com/repos/paperjs/paper.js/issues/845/events","html_url":"https://github.com/paperjs/paper.js/issues/845","id":120313476,"number":845,"title":"path.on('drag', ...) not called when using view.on('drag', ...)","user":{"login":"bmacnaughton","id":4171707,"avatar_url":"https://avatars.githubusercontent.com/u/4171707?v=3","gravatar_id":"","url":"https://api.github.com/users/bmacnaughton","html_url":"https://github.com/bmacnaughton","followers_url":"https://api.github.com/users/bmacnaughton/followers","following_url":"https://api.github.com/users/bmacnaughton/following{/other_user}","gists_url":"https://api.github.com/users/bmacnaughton/gists{/gist_id}","starred_url":"https://api.github.com/users/bmacnaughton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmacnaughton/subscriptions","organizations_url":"https://api.github.com/users/bmacnaughton/orgs","repos_url":"https://api.github.com/users/bmacnaughton/repos","events_url":"https://api.github.com/users/bmacnaughton/events{/privacy}","received_events_url":"https://api.github.com/users/bmacnaughton/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/paperjs/paper.js/labels/cat:%20event-handling","name":"cat: event-handling","color":"c7def8"},{"url":"https://api.github.com/repos/paperjs/paper.js/labels/type:%20bug","name":"type: bug","color":"e11d21"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2015-12-04T01:42:36Z","updated_at":"2016-01-14T19:15:55Z","closed_at":"2016-01-13T01:11:35Z","body":"Here's a [sketch](http://sketch.paperjs.org/#S/7VXBbtswDP0Vwpc4QWpjVxc7tccVK5IOO8zDoNiMrcYmDUmOMRT591Fy0sRZ2/MO0yWQxDy+x0fRLxGpFqMsWu/QFXW0jAou/T5N4c6gcggKjLIODWiHLfRWUwWuRvi2+pLTXpnT9WcgHGAVNnEe1c51WZp2qkPzbBM2Vep6x0arxqa6VRXadGCzE7ibQbv6ZoSxacukkueuyqP5bU45CZMH3mPIeUzlOOwKJL/jbdjtNQ45jRFJx1Y7zSSs/HkyhgY8T9k6Zdy9UdUja3Lh2JN/Ym7iMeu2pyIAMD1wb/GeB4pxLzBzeMkJZE1BJFO4ltQj5OHIfgEGWy+ACcE2ytaef6t2XpK2oElJpj0KM8+UKZ61PmMpyLMlnIhcJfcrKKl5WGODxVGtl/GoXJ2s5EhR1WB88Q+/tobb7Ir8chriOLsUc3VrneEd3nHDJoOZwXL2ZsB3Xbo6g0/nu8NY2tNWjF077oKEU1PZIAVLUNJ8UjHwVYDYq/Llk3IVoSvLOSgqoe9gg4WSasGAQgVKiTpnmBQnGW34StcF8SkycKbHKx19Nx5PFPgfMXceGnORBo8XoEqhfHRXuSBlg5UmCsIu7T6Z/VeDCYv/Hv8bHo+P99Xfgslyg0nDVXycL79C6Z5+d2iT8Fr7bhT+OoHO71gmx/vv+BI7j3ysn3uhw27fRPtwKkzRknGEvoPUdx9OlylU311ggXwmNmLRLnSOjbIfPw9/AA==) showing two different ways to implement the view.on handler - one uses a tool (implicitly via global declaration); the other uses `view.on`.\r\n\r\n\r\nIt looks like the problem is 1) that the following code in View.js doesn't invoke `tool._handleEvent` because there is no tool, combined with 2) `view._handleEvent` doesn't invoke the same functionality as `tool._fireEvent` where the logic to do `path.remove()` on `mousedrag` events is invoked.\r\n\r\n```\r\nfunction handleMouseMove(view, point, event) {\r\n        view._handleEvent('mousemove', point, event);\r\n        var tool = view._scope.tool;\r\n        if (tool) {\r\n            // If there's no onMouseDrag, fire onMouseMove while dragging.\r\n            tool._handleEvent(dragging && tool.responds('mousedrag')\r\n                    ? 'mousedrag' : 'mousemove', point, event);\r\n        }\r\n        view.update();\r\n        return tool;\r\n    }\r\n```\r\n\r\nI could take a stab at fixing it but the simple way is to duplicate code. It seems like a more comprehensive rationalization of the implicit global tool handlers might be a better approach, but it's not clear to me the right way to approach that."},"comment":{"url":"https://api.github.com/repos/paperjs/paper.js/issues/comments/171747690","html_url":"https://github.com/paperjs/paper.js/issues/845#issuecomment-171747690","issue_url":"https://api.github.com/repos/paperjs/paper.js/issues/845","id":171747690,"user":{"login":"bmacnaughton","id":4171707,"avatar_url":"https://avatars.githubusercontent.com/u/4171707?v=3","gravatar_id":"","url":"https://api.github.com/users/bmacnaughton","html_url":"https://github.com/bmacnaughton","followers_url":"https://api.github.com/users/bmacnaughton/followers","following_url":"https://api.github.com/users/bmacnaughton/following{/other_user}","gists_url":"https://api.github.com/users/bmacnaughton/gists{/gist_id}","starred_url":"https://api.github.com/users/bmacnaughton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmacnaughton/subscriptions","organizations_url":"https://api.github.com/users/bmacnaughton/orgs","repos_url":"https://api.github.com/users/bmacnaughton/repos","events_url":"https://api.github.com/users/bmacnaughton/events{/privacy}","received_events_url":"https://api.github.com/users/bmacnaughton/received_events","type":"User","site_admin":false},"created_at":"2016-01-14T19:15:55Z","updated_at":"2016-01-14T19:15:55Z","body":"It's working now when I run either way. I was putting a symbolic link in my application local directory but then the scripts didn't have the correct directory base for their references.\r\n\r\nThe setup that wasn't working used `<script src=\"vendor/paper-full.js\"></script>` where the server mapped `vendor/` to `app/vendor/paper-full.js`. I put the following symbolic link in the vendor directory but that meant the scripts didn't have the right working directory to execute in. \r\n\r\n```\r\napp/vendor/paper-full.js -> /home/bruce/Scripts/github/paper.js/dist/paper-full.js\r\n```\r\n\r\nThe setup that works for me is to use `<script src=\"paper/paper-full.js\"></script> where the server maps `paper/` to `/home/bruce/Scripts/github/paper.js/dist/paper-full.js`.\r\n\r\nI think everything is up-to-date. Executing those steps got me working; I had just presumed I was set up from long ago and then compounded the error with trying to go one symbolic link too far. I hadn't thought through the fact that the scripts aren't working-directory independent. \r\n\r\nThe documentation is quite nice actually. Thanks for pointing me at it.\r\n"}}