{"action":"created","issue":{"url":"https://api.github.com/repos/paperjs/paper.js/issues/831","repository_url":"https://api.github.com/repos/paperjs/paper.js","labels_url":"https://api.github.com/repos/paperjs/paper.js/issues/831/labels{/name}","comments_url":"https://api.github.com/repos/paperjs/paper.js/issues/831/comments","events_url":"https://api.github.com/repos/paperjs/paper.js/issues/831/events","html_url":"https://github.com/paperjs/paper.js/issues/831","id":117541693,"number":831,"title":"Shadow doesnt scale when zooming the view ","user":{"login":"tobmaster","id":203823,"avatar_url":"https://avatars.githubusercontent.com/u/203823?v=3","gravatar_id":"","url":"https://api.github.com/users/tobmaster","html_url":"https://github.com/tobmaster","followers_url":"https://api.github.com/users/tobmaster/followers","following_url":"https://api.github.com/users/tobmaster/following{/other_user}","gists_url":"https://api.github.com/users/tobmaster/gists{/gist_id}","starred_url":"https://api.github.com/users/tobmaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobmaster/subscriptions","organizations_url":"https://api.github.com/users/tobmaster/orgs","repos_url":"https://api.github.com/users/tobmaster/repos","events_url":"https://api.github.com/users/tobmaster/events{/privacy}","received_events_url":"https://api.github.com/users/tobmaster/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/paperjs/paper.js/labels/cat:%20canvas-rendering","name":"cat: canvas-rendering","color":"c7def8"},{"url":"https://api.github.com/repos/paperjs/paper.js/labels/type:%20bug","name":"type: bug","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":25,"created_at":"2015-11-18T08:57:39Z","updated_at":"2016-02-14T06:36:30Z","closed_at":null,"body":"When I define a Symbol/item like this\r\n\r\n```\r\nnew paper.Symbol(\r\n      new paper.Shape.Circle({\r\n        center: [0, 0],\r\n        radius: 5,\r\n        fillColor: 'lime',\r\n        strokeColor: 'green',\r\n        shadowColor: new Color(0, 0, 0),\r\n        shadowBlur: 6,\r\n        shadowOffset: new Point(3, 3)\r\n      })\r\n    );\r\n```\r\n\r\nI expected the shadow to resize as the circle does. Instead its size is steady and changes the distance to the circle when zooming out and is disappearing behind the circle when zooming in. \r\n\r\nAs I am new to paperjs it still might do something wrong but it appears as a bug."},"comment":{"url":"https://api.github.com/repos/paperjs/paper.js/issues/comments/183832083","html_url":"https://github.com/paperjs/paper.js/issues/831#issuecomment-183832083","issue_url":"https://api.github.com/repos/paperjs/paper.js/issues/831","id":183832083,"user":{"login":"iconexperience","id":2122773,"avatar_url":"https://avatars.githubusercontent.com/u/2122773?v=3","gravatar_id":"","url":"https://api.github.com/users/iconexperience","html_url":"https://github.com/iconexperience","followers_url":"https://api.github.com/users/iconexperience/followers","following_url":"https://api.github.com/users/iconexperience/following{/other_user}","gists_url":"https://api.github.com/users/iconexperience/gists{/gist_id}","starred_url":"https://api.github.com/users/iconexperience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iconexperience/subscriptions","organizations_url":"https://api.github.com/users/iconexperience/orgs","repos_url":"https://api.github.com/users/iconexperience/repos","events_url":"https://api.github.com/users/iconexperience/events{/privacy}","received_events_url":"https://api.github.com/users/iconexperience/received_events","type":"User","site_admin":false},"created_at":"2016-02-14T06:36:30Z","updated_at":"2016-02-14T06:36:30Z","body":"Fixing the zooming issue would actually be quite easy, we only have to multiply with the pixel ratio when setting the shadow offset and shadow blur to the canvas. Like this (<a href=\"https://github.com/paperjs/paper.js/blob/develop/src/item/Item.js#L3953\">in Item.js lines 3953ff</a>):\r\n\r\n```\r\nctx.shadowBlur = style.getShadowBlur() * (_pixelRatio || 1);\r\nvar offset = this.getShadowOffset();\r\nctx.shadowOffsetX = offset.x * (_pixelRatio || 1);\r\nctx.shadowOffsetY = offset.y * (_pixelRatio || 1);\r\n```\r\nThe problem is that at the moment we do not have access to `_pixelRatio`there, because it is stored in the view, but we only have access to the canvas context at that place."}}