{"action":"created","issue":{"url":"https://api.github.com/repos/kangax/fabric.js/issues/2425","labels_url":"https://api.github.com/repos/kangax/fabric.js/issues/2425/labels{/name}","comments_url":"https://api.github.com/repos/kangax/fabric.js/issues/2425/comments","events_url":"https://api.github.com/repos/kangax/fabric.js/issues/2425/events","html_url":"https://github.com/kangax/fabric.js/issues/2425","id":101456859,"number":2425,"title":"Problem with zoom and scale","user":{"login":"Envo","id":1453516,"avatar_url":"https://avatars.githubusercontent.com/u/1453516?v=3","gravatar_id":"","url":"https://api.github.com/users/Envo","html_url":"https://github.com/Envo","followers_url":"https://api.github.com/users/Envo/followers","following_url":"https://api.github.com/users/Envo/following{/other_user}","gists_url":"https://api.github.com/users/Envo/gists{/gist_id}","starred_url":"https://api.github.com/users/Envo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Envo/subscriptions","organizations_url":"https://api.github.com/users/Envo/orgs","repos_url":"https://api.github.com/users/Envo/repos","events_url":"https://api.github.com/users/Envo/events{/privacy}","received_events_url":"https://api.github.com/users/Envo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-17T16:13:34Z","updated_at":"2015-08-17T16:20:30Z","closed_at":null,"body":"Hi there,\r\n\r\nI have a little problem with the zoom functionality, and i don't see where i miss the point. Can anyone solved this before?\r\nVideo about the effect (look at the scale borders): https://www.youtube.com/watch?v=0QBtZF8szOE\r\n\r\nAnd a code which i use:\r\n```javascript\r\nzoom: function(factor) {\r\n\tdesigner.ctx.setHeight(designer.ctx.getHeight() * factor);\r\n\tdesigner.ctx.setWidth(designer.ctx.getWidth() * factor);\r\n\tif (designer.ctx.backgroundImage) {\r\n\t\tvar bi = designer.ctx.backgroundImage;\r\n\t\tbi.width = bi.width * factor;\r\n\t\tbi.height = bi.height * factor;\r\n\t}\r\n\tvar objects = designer.ctx.getObjects();\r\n\tfor (var i in objects) {\r\n\t\tvar scaleX = objects[i].scaleX,\r\n\t\t\tscaleY = objects[i].scaleY,\r\n\t\t\tleft = objects[i].left,\r\n\t\t\ttop = objects[i].top,\r\n\t\t\twidth = objects[i].width,\r\n\t\t\theight = objects[i].height;\r\n\t\t\t\t\t\r\n\t\tvar tempScaleX = scaleX * factor,\r\n\t\t\ttempScaleY = scaleY * factor,\r\n\t\t\ttempLeft = left * factor,\r\n\t\t\ttempTop = top * factor;\r\n\r\n\t\tobjects[i].scaleX = tempScaleX;\r\n\t\tobjects[i].scaleY = tempScaleY;\r\n\t\tobjects[i].left = tempLeft;\r\n\t\tobjects[i].top = tempTop;\r\n\t\tobjects[i].setCoords();\r\n\t}\r\n\tdesigner.ctx.calcOffset();\r\n\tdesigner.ctx.renderAll();\r\n}\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/kangax/fabric.js/issues/comments/131878136","html_url":"https://github.com/kangax/fabric.js/issues/2425#issuecomment-131878136","issue_url":"https://api.github.com/repos/kangax/fabric.js/issues/2425","id":131878136,"user":{"login":"asturur","id":1194048,"avatar_url":"https://avatars.githubusercontent.com/u/1194048?v=3","gravatar_id":"","url":"https://api.github.com/users/asturur","html_url":"https://github.com/asturur","followers_url":"https://api.github.com/users/asturur/followers","following_url":"https://api.github.com/users/asturur/following{/other_user}","gists_url":"https://api.github.com/users/asturur/gists{/gist_id}","starred_url":"https://api.github.com/users/asturur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asturur/subscriptions","organizations_url":"https://api.github.com/users/asturur/orgs","repos_url":"https://api.github.com/users/asturur/repos","events_url":"https://api.github.com/users/asturur/events{/privacy}","received_events_url":"https://api.github.com/users/asturur/received_events","type":"User","site_admin":false},"created_at":"2015-08-17T16:20:30Z","updated_at":"2015-08-17T16:20:30Z","body":"Please try to use fabricjs own zoom functions:\r\n\r\ncanvas.setZoom(x) \r\n\r\nWe cannot support custom zooming function when there is one built in."}}