{"action":"created","issue":{"url":"https://api.github.com/repos/konvajs/konva/issues/24","labels_url":"https://api.github.com/repos/konvajs/konva/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/konvajs/konva/issues/24/comments","events_url":"https://api.github.com/repos/konvajs/konva/issues/24/events","html_url":"https://github.com/konvajs/konva/issues/24","id":57615125,"number":24,"title":"Expose measureText from canvas context","user":{"login":"ptorian","id":133235,"avatar_url":"https://avatars.githubusercontent.com/u/133235?v=3","gravatar_id":"","url":"https://api.github.com/users/ptorian","html_url":"https://github.com/ptorian","followers_url":"https://api.github.com/users/ptorian/followers","following_url":"https://api.github.com/users/ptorian/following{/other_user}","gists_url":"https://api.github.com/users/ptorian/gists{/gist_id}","starred_url":"https://api.github.com/users/ptorian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ptorian/subscriptions","organizations_url":"https://api.github.com/users/ptorian/orgs","repos_url":"https://api.github.com/users/ptorian/repos","events_url":"https://api.github.com/users/ptorian/events{/privacy}","received_events_url":"https://api.github.com/users/ptorian/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-13T15:53:29Z","updated_at":"2015-02-13T23:14:51Z","closed_at":null,"body":"It would be convenient to have the canvas context method \"measureText\" exposed in the Konva.Context class. I'm new to the framework, but it seems like that could be accomplished by adding this function to the Konva.Context prototype:\r\n\r\n    measureText: function() {\r\n        var a = arguments;\r\n        return this._context.measureText(a[0]);\r\n    }\r\n\r\nLike I said, I'm new to the framework, so feel free to let me know if/why this won't work or doesn't fit as well as how to actually contribute the change if it does fit."},"comment":{"url":"https://api.github.com/repos/konvajs/konva/issues/comments/74344035","html_url":"https://github.com/konvajs/konva/issues/24#issuecomment-74344035","issue_url":"https://api.github.com/repos/konvajs/konva/issues/24","id":74344035,"user":{"login":"lavrton","id":1443320,"avatar_url":"https://avatars.githubusercontent.com/u/1443320?v=3","gravatar_id":"","url":"https://api.github.com/users/lavrton","html_url":"https://github.com/lavrton","followers_url":"https://api.github.com/users/lavrton/followers","following_url":"https://api.github.com/users/lavrton/following{/other_user}","gists_url":"https://api.github.com/users/lavrton/gists{/gist_id}","starred_url":"https://api.github.com/users/lavrton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lavrton/subscriptions","organizations_url":"https://api.github.com/users/lavrton/orgs","repos_url":"https://api.github.com/users/lavrton/repos","events_url":"https://api.github.com/users/lavrton/events{/privacy}","received_events_url":"https://api.github.com/users/lavrton/received_events","type":"User","site_admin":false},"created_at":"2015-02-13T23:14:51Z","updated_at":"2015-02-13T23:14:51Z","body":"Why do you need such method? You can create `Konva.Text` instance. And then use `width()` and `height()` functions."}}