{"action":"closed","issue":{"url":"https://api.github.com/repos/cappuccino/cappuccino/issues/2361","labels_url":"https://api.github.com/repos/cappuccino/cappuccino/issues/2361/labels{/name}","comments_url":"https://api.github.com/repos/cappuccino/cappuccino/issues/2361/comments","events_url":"https://api.github.com/repos/cappuccino/cappuccino/issues/2361/events","html_url":"https://github.com/cappuccino/cappuccino/issues/2361","id":87645460,"number":2361,"title":"CPButton sizeToFit: Resize dosen't work correctly after a new title was set","user":{"login":"cpasslack","id":11424968,"avatar_url":"https://avatars.githubusercontent.com/u/11424968?v=3","gravatar_id":"","url":"https://api.github.com/users/cpasslack","html_url":"https://github.com/cpasslack","followers_url":"https://api.github.com/users/cpasslack/followers","following_url":"https://api.github.com/users/cpasslack/following{/other_user}","gists_url":"https://api.github.com/users/cpasslack/gists{/gist_id}","starred_url":"https://api.github.com/users/cpasslack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpasslack/subscriptions","organizations_url":"https://api.github.com/users/cpasslack/orgs","repos_url":"https://api.github.com/users/cpasslack/repos","events_url":"https://api.github.com/users/cpasslack/events{/privacy}","received_events_url":"https://api.github.com/users/cpasslack/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cappuccino/cappuccino/labels/%23accepted","name":"#accepted","color":"f4d372"},{"url":"https://api.github.com/repos/cappuccino/cappuccino/labels/%23needs-patch","name":"#needs-patch","color":"fff37a"},{"url":"https://api.github.com/repos/cappuccino/cappuccino/labels/AppKit","name":"AppKit","color":"ededed"},{"url":"https://api.github.com/repos/cappuccino/cappuccino/labels/bug","name":"bug","color":"adcdff"},{"url":"https://api.github.com/repos/cappuccino/cappuccino/labels/regression","name":"regression","color":"fb5451"}],"state":"closed","locked":false,"assignee":{"login":"Dogild","id":2860781,"avatar_url":"https://avatars.githubusercontent.com/u/2860781?v=3","gravatar_id":"","url":"https://api.github.com/users/Dogild","html_url":"https://github.com/Dogild","followers_url":"https://api.github.com/users/Dogild/followers","following_url":"https://api.github.com/users/Dogild/following{/other_user}","gists_url":"https://api.github.com/users/Dogild/gists{/gist_id}","starred_url":"https://api.github.com/users/Dogild/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dogild/subscriptions","organizations_url":"https://api.github.com/users/Dogild/orgs","repos_url":"https://api.github.com/users/Dogild/repos","events_url":"https://api.github.com/users/Dogild/events{/privacy}","received_events_url":"https://api.github.com/users/Dogild/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/cappuccino/cappuccino/milestones/4","html_url":"https://github.com/cappuccino/cappuccino/milestones/Someday","labels_url":"https://api.github.com/repos/cappuccino/cappuccino/milestones/4/labels","id":107283,"number":4,"title":"Someday","description":"","creator":{"login":"aparajita","id":22218,"avatar_url":"https://avatars.githubusercontent.com/u/22218?v=3","gravatar_id":"","url":"https://api.github.com/users/aparajita","html_url":"https://github.com/aparajita","followers_url":"https://api.github.com/users/aparajita/followers","following_url":"https://api.github.com/users/aparajita/following{/other_user}","gists_url":"https://api.github.com/users/aparajita/gists{/gist_id}","starred_url":"https://api.github.com/users/aparajita/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aparajita/subscriptions","organizations_url":"https://api.github.com/users/aparajita/orgs","repos_url":"https://api.github.com/users/aparajita/repos","events_url":"https://api.github.com/users/aparajita/events{/privacy}","received_events_url":"https://api.github.com/users/aparajita/received_events","type":"User","site_admin":false},"open_issues":86,"closed_issues":639,"state":"open","created_at":"2012-04-12T21:50:28Z","updated_at":"2015-06-24T21:37:01Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2015-06-12T07:52:15Z","updated_at":"2015-06-24T21:37:01Z","closed_at":"2015-06-24T21:37:01Z","body":"CPButton sizeToFit dosen't work after the title of an CPButton has changed. Here is my reduction:\r\n\r\n```Objective-J\r\nvar aButton = [[CPButton alloc] initWithFrame:CGRectMakeZero()];\r\n[aButton setTitle:\"Some text\"];\r\n[aButton sizeToFit];\r\n[aButton setTitle:\"Some more text which will be cutted\"];\t\r\n[aButton sizeToFit];\r\n```\r\n\r\nI investigated a bit around and I think the problem exists since commit 7323a5e393b74b49842d4cb5478804f1e57d0c23  \r\n\r\nIt seems it is necessary to call layoutSubviews first, otherwise _minimumFrameSize will a return the \"dirty\"-rect with the size of the old titled CPButton. A workaround is to call sizeToFit twice after a new title was set.\r\n\r\nTested and confirmend with 0.9.8 Starter Package"}}