{"action":"opened","issue":{"url":"https://api.github.com/repos/servo/core-foundation-rs/issues/164","repository_url":"https://api.github.com/repos/servo/core-foundation-rs","labels_url":"https://api.github.com/repos/servo/core-foundation-rs/issues/164/labels{/name}","comments_url":"https://api.github.com/repos/servo/core-foundation-rs/issues/164/comments","events_url":"https://api.github.com/repos/servo/core-foundation-rs/issues/164/events","html_url":"https://github.com/servo/core-foundation-rs/issues/164","id":293698701,"number":164,"title":"How to use nsview.layer?","user":{"login":"bors-servo","id":4368172,"avatar_url":"https://avatars1.githubusercontent.com/u/4368172?v=4","gravatar_id":"","url":"https://api.github.com/users/bors-servo","html_url":"https://github.com/bors-servo","followers_url":"https://api.github.com/users/bors-servo/followers","following_url":"https://api.github.com/users/bors-servo/following{/other_user}","gists_url":"https://api.github.com/users/bors-servo/gists{/gist_id}","starred_url":"https://api.github.com/users/bors-servo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bors-servo/subscriptions","organizations_url":"https://api.github.com/users/bors-servo/orgs","repos_url":"https://api.github.com/users/bors-servo/repos","events_url":"https://api.github.com/users/bors-servo/events{/privacy}","received_events_url":"https://api.github.com/users/bors-servo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-01T21:59:12Z","updated_at":"2018-02-01T21:59:12Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"<a href=\"https://github.com/paulrouget\"><img src=\"https://avatars0.githubusercontent.com/u/373579?v=4\" align=\"left\" width=\"96\" height=\"96\" hspace=\"10\"></img></a> **Issue by [paulrouget](https://github.com/paulrouget)**\n_Friday Mar 17, 2017 at 08:08 GMT_\n_Originally opened as https://github.com/servo/core-graphics-rs/issues/78_\n\n----\n\nI'm trying to animate a Cocoa nsview via its [layer](https://developer.apple.com/reference/quartzcore/calayer). But with no luck. What would it take to make it work?\r\n\r\nI'm trying for example to set the opacity of a layer. All [the conditions](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/CoreAnimation_guide/SettingUpLayerObjects/SettingUpLayerObjects.html\r\n) to enable core animation are met.\r\n\r\nThis code crashes:\r\n\r\n```rust\r\nlet content_view: id = msg_send![nswindow, contentView];\r\nlet layer: id = msg_send![content_view, layer];\r\nlet transform: CGAffineTransform = msg_send![layer, affineTransform];\r\nmsg_send![layer, setAffineTransform:transform];\r\n```\r\n\r\nAnd this code behaves in a strange way:\r\n\r\n```rust\r\nlet content_view: id = msg_send![nswindow, contentView];\r\nlet layer: id = msg_send![content_view, layer];\r\nlet opacity: CGFloat = msg_send![layer, opacity];\r\n// opacity is equal to 0.\r\nlet opacity: CGFloat = 0.5;\r\nmsg_send![layer, setOpacity:opacity];\r\n// view disappear\r\nlet opacity: CGFloat = msg_send![layer, opacity];\r\n// opacity is still equal to 0.\r\n```\n"}}
{"actor":{"display_login":"bors-servo"}}