{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/2677","repository_url":"https://api.github.com/repos/facebook/AsyncDisplayKit","labels_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/2677/labels{/name}","comments_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/2677/comments","events_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/2677/events","html_url":"https://github.com/facebook/AsyncDisplayKit/issues/2677","id":192211177,"number":2677,"title":"[ASTextNode] Center-aligned text not rendering correctly ","user":{"login":"GitGadd","id":3338062,"avatar_url":"https://avatars.githubusercontent.com/u/3338062?v=3","gravatar_id":"","url":"https://api.github.com/users/GitGadd","html_url":"https://github.com/GitGadd","followers_url":"https://api.github.com/users/GitGadd/followers","following_url":"https://api.github.com/users/GitGadd/following{/other_user}","gists_url":"https://api.github.com/users/GitGadd/gists{/gist_id}","starred_url":"https://api.github.com/users/GitGadd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GitGadd/subscriptions","organizations_url":"https://api.github.com/users/GitGadd/orgs","repos_url":"https://api.github.com/users/GitGadd/repos","events_url":"https://api.github.com/users/GitGadd/events{/privacy}","received_events_url":"https://api.github.com/users/GitGadd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/milestones/22","html_url":"https://github.com/facebook/AsyncDisplayKit/milestones/2.0.1","labels_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/milestones/22/labels","id":2132538,"number":22,"title":"2.0.1","description":"","creator":{"login":"hannahmbanana","id":3419380,"avatar_url":"https://avatars.githubusercontent.com/u/3419380?v=3","gravatar_id":"","url":"https://api.github.com/users/hannahmbanana","html_url":"https://github.com/hannahmbanana","followers_url":"https://api.github.com/users/hannahmbanana/followers","following_url":"https://api.github.com/users/hannahmbanana/following{/other_user}","gists_url":"https://api.github.com/users/hannahmbanana/gists{/gist_id}","starred_url":"https://api.github.com/users/hannahmbanana/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hannahmbanana/subscriptions","organizations_url":"https://api.github.com/users/hannahmbanana/orgs","repos_url":"https://api.github.com/users/hannahmbanana/repos","events_url":"https://api.github.com/users/hannahmbanana/events{/privacy}","received_events_url":"https://api.github.com/users/hannahmbanana/received_events","type":"User","site_admin":false},"open_issues":28,"closed_issues":2,"state":"open","created_at":"2016-11-14T04:32:37Z","updated_at":"2016-11-30T09:36:50Z","due_on":null,"closed_at":null},"comments":5,"created_at":"2016-11-29T07:51:52Z","updated_at":"2016-11-30T15:53:49Z","closed_at":null,"body":"After updating from 2.0-beta.1 to 2.0-beta.2, center-aligned text in our custom alerts is rendering incorrectly. Note that using 'left' text alignment and taking the same screenshot looks OK.\r\n\r\nUpdate: Manually setting the style.width of each ASTextNode to the expected width seems to fix it as a work-around, but would obviously break down if the constrained width was a range.\r\n\r\nScreenshot of issue:\r\n\r\n![screen shot 2016-11-29 at 08 41 08](https://cloud.githubusercontent.com/assets/3338062/20700785/a0160550-b60f-11e6-98cc-2048a8ed013c.png)\r\n\r\nAttributed text creation:\r\n```\r\ntitleAttributes[NSParagraphStyleAttributeName] = {\r\n    let para = NSMutableParagraphStyle()\r\n    para.alignment = .center\r\n    return para\r\n}()\r\ntitleNode.attributedText = NSAttributedString(string: title, attributes: titleAttributes)\r\n```\r\n\r\nLayout:\r\n```\r\nfileprivate override func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -> ASLayoutSpec {\r\n\t\tvar children = [titleNode]\r\n\t\tif let messageNode=messageNode {\r\n\t\t\tchildren.append(messageNode)\r\n\t\t}\r\n\t\treturn ASBackgroundLayoutSpec(\r\n\t\t\tchild: ASInsetLayoutSpec(\r\n\t\t\t\tinsets: UIEdgeInsets(horizontal: AXTheme.defaultMargin*2, vertical: AXTheme.defaultMargin*3),\r\n\t\t\t\tchild: ASStackLayoutSpec(direction: .vertical,\r\n\t\t\t\t\tspacing: AXTheme.defaultMargin,\r\n\t\t\t\t\tjustifyContent: .start,\r\n\t\t\t\t\talignItems: .center,\r\n\t\t\t\t\tchildren: children)),\r\n\t\t\tbackground: backgroundImageNode)\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/comments/263909817","html_url":"https://github.com/facebook/AsyncDisplayKit/issues/2677#issuecomment-263909817","issue_url":"https://api.github.com/repos/facebook/AsyncDisplayKit/issues/2677","id":263909817,"user":{"login":"GitGadd","id":3338062,"avatar_url":"https://avatars.githubusercontent.com/u/3338062?v=3","gravatar_id":"","url":"https://api.github.com/users/GitGadd","html_url":"https://github.com/GitGadd","followers_url":"https://api.github.com/users/GitGadd/followers","following_url":"https://api.github.com/users/GitGadd/following{/other_user}","gists_url":"https://api.github.com/users/GitGadd/gists{/gist_id}","starred_url":"https://api.github.com/users/GitGadd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GitGadd/subscriptions","organizations_url":"https://api.github.com/users/GitGadd/orgs","repos_url":"https://api.github.com/users/GitGadd/repos","events_url":"https://api.github.com/users/GitGadd/events{/privacy}","received_events_url":"https://api.github.com/users/GitGadd/received_events","type":"User","site_admin":false},"created_at":"2016-11-30T15:53:49Z","updated_at":"2016-11-30T15:53:49Z","body":"Thanks Maicki!\r\n\r\nI really appreciate you digging into this, but the reason I posted the project to reproduce the issue was in case somebody wanted to dig into the underlying issue. The issues in our app are already resolved (by removing the flexBasis line). \r\n\r\nI can't really elaborate on the flexBasis as I don't know why it was there in the first place, but the weird thing is that the flexBasis was being set on the vertical stack, not the horizontal one."}}
{"actor":{"display_login":"GitGadd"}}