{"action":"created","issue":{"url":"https://api.github.com/repos/kangax/fabric.js/issues/3383","repository_url":"https://api.github.com/repos/kangax/fabric.js","labels_url":"https://api.github.com/repos/kangax/fabric.js/issues/3383/labels{/name}","comments_url":"https://api.github.com/repos/kangax/fabric.js/issues/3383/comments","events_url":"https://api.github.com/repos/kangax/fabric.js/issues/3383/events","html_url":"https://github.com/kangax/fabric.js/pull/3383","id":185835409,"number":3383,"title":"adding object properties of snapAngle and snapThreshold to enable object snapping.","user":{"login":"stefanhayden","id":87616,"avatar_url":"https://avatars.githubusercontent.com/u/87616?v=3","gravatar_id":"","url":"https://api.github.com/users/stefanhayden","html_url":"https://github.com/stefanhayden","followers_url":"https://api.github.com/users/stefanhayden/followers","following_url":"https://api.github.com/users/stefanhayden/following{/other_user}","gists_url":"https://api.github.com/users/stefanhayden/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanhayden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanhayden/subscriptions","organizations_url":"https://api.github.com/users/stefanhayden/orgs","repos_url":"https://api.github.com/users/stefanhayden/repos","events_url":"https://api.github.com/users/stefanhayden/events{/privacy}","received_events_url":"https://api.github.com/users/stefanhayden/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-10-28T04:17:40Z","updated_at":"2016-11-13T22:33:39Z","closed_at":"2016-10-29T07:55:41Z","pull_request":{"url":"https://api.github.com/repos/kangax/fabric.js/pulls/3383","html_url":"https://github.com/kangax/fabric.js/pull/3383","diff_url":"https://github.com/kangax/fabric.js/pull/3383.diff","patch_url":"https://github.com/kangax/fabric.js/pull/3383.patch"},"body":"Adds a way to set an angle interval to snap to during rotation (`snapAngle`) and the ability to set the threshold of how far away it snaps to that angle (`snapThreshold`).\n\nWhen the `snapThreshold` is null (the default) it will use the `snapAngle` until the user sets the `snapThreshold`. This is good because it makes the api easier to use and also setting the `snapAngle` will feel more obvious with the threshold and the angle the same.\n\nHere is an example of just the `snapAngle` set toe 45:\n![fabric](https://cloud.githubusercontent.com/assets/87616/19794782/33c0a23c-9ca3-11e6-8250-076ecde78521.gif)\n\n@asturur mentioned adding a shift or alt modifier key to turn the behavior off but I think that might be better handled in code like so:\n\n```\nrect.on('rotating', function(options) {\n  if(options.e.shiftKey) {\n    this.snapAngle = 0;\n  } else {\n    this.snapAngle = 45;\n  }\n});\n```\n\nTo me this keep fabric feeling more like a tool, while assigning predetermined modifier keys to disable behavior makes the library feel more opinionated then a tool should be. This code to disable the snap behavior could easily go in a tutorial somewhere.\n\nclose #3369\n"},"comment":{"url":"https://api.github.com/repos/kangax/fabric.js/issues/comments/260218105","html_url":"https://github.com/kangax/fabric.js/pull/3383#issuecomment-260218105","issue_url":"https://api.github.com/repos/kangax/fabric.js/issues/3383","id":260218105,"user":{"login":"ncou","id":16743322,"avatar_url":"https://avatars.githubusercontent.com/u/16743322?v=3","gravatar_id":"","url":"https://api.github.com/users/ncou","html_url":"https://github.com/ncou","followers_url":"https://api.github.com/users/ncou/followers","following_url":"https://api.github.com/users/ncou/following{/other_user}","gists_url":"https://api.github.com/users/ncou/gists{/gist_id}","starred_url":"https://api.github.com/users/ncou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncou/subscriptions","organizations_url":"https://api.github.com/users/ncou/orgs","repos_url":"https://api.github.com/users/ncou/repos","events_url":"https://api.github.com/users/ncou/events{/privacy}","received_events_url":"https://api.github.com/users/ncou/received_events","type":"User","site_admin":false},"created_at":"2016-11-13T22:33:39Z","updated_at":"2016-11-13T22:33:39Z","body":"Thank you, i understand better how to use this. hope this will go in the documentation. have a good day"}}
{"actor":{"display_login":"ncou"}}