{"action":"closed","issue":{"url":"https://api.github.com/repos/konvajs/konva/issues/48","labels_url":"https://api.github.com/repos/konvajs/konva/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/konvajs/konva/issues/48/comments","events_url":"https://api.github.com/repos/konvajs/konva/issues/48/events","html_url":"https://github.com/konvajs/konva/issues/48","id":68091806,"number":48,"title":"drawHitFromCache issues on retina","user":{"login":"pronebird","id":704044,"avatar_url":"https://avatars.githubusercontent.com/u/704044?v=3","gravatar_id":"","url":"https://api.github.com/users/pronebird","html_url":"https://github.com/pronebird","followers_url":"https://api.github.com/users/pronebird/followers","following_url":"https://api.github.com/users/pronebird/following{/other_user}","gists_url":"https://api.github.com/users/pronebird/gists{/gist_id}","starred_url":"https://api.github.com/users/pronebird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pronebird/subscriptions","organizations_url":"https://api.github.com/users/pronebird/orgs","repos_url":"https://api.github.com/users/pronebird/repos","events_url":"https://api.github.com/users/pronebird/events{/privacy}","received_events_url":"https://api.github.com/users/pronebird/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-04-13T13:06:33Z","updated_at":"2015-04-14T03:50:16Z","closed_at":"2015-04-14T03:50:16Z","body":"Hi,\r\n\r\nIt seems that `drawHitFromCache` does not work properly anymore.\r\n\r\nI have the following configuration:\r\n\r\n- Group\r\n    - Image\r\n\r\n```js\r\n// get image from group\r\nvar image = group.findOne('.image');\r\n\r\n// reset offset if was previously set\r\nimage.offset({ x: 0, y: 0 });\r\n\r\n// cache image\r\nimage.cache();\r\n\r\n// update hit from image\r\nimage.drawHitFromCache();\r\n\r\n// restore offset\r\nimage.offset({\r\n  x: DRAG_STROKE_WIDTH,\r\n  y: DRAG_STROKE_WIDTH\r\n});\r\n\r\n// redraw layer's hit map\r\nthis.layer().drawHit();\r\n```\r\n\r\nI have a retina display, but if I set `Konva.pixelRatio = 1;` then everything works as expected. I guess this issue is connected to #46\r\n\r\nChanging hitCanvas to use the same pixelRatio helps, then the fix is the same as I used for filter canvas:\r\n\r\n```js\r\ncontext.drawImage(hitCanvas._canvas, 0, 0, hitCanvas.width / ratio, hitCanvas.height / ratio);\r\n```\r\n(I had to remove pixelRatio setting for hitCanvas so it could use device pixelRatio)\r\n\r\nBut hey we could probably use low-detail hitCanvas and stretch it, I guess that was the point of fixing hitCanvas at pixelRatio = 1."}}