{"action":"created","issue":{"url":"https://api.github.com/repos/PistonDevelopers/conrod/issues/655","labels_url":"https://api.github.com/repos/PistonDevelopers/conrod/issues/655/labels{/name}","comments_url":"https://api.github.com/repos/PistonDevelopers/conrod/issues/655/comments","events_url":"https://api.github.com/repos/PistonDevelopers/conrod/issues/655/events","html_url":"https://github.com/PistonDevelopers/conrod/issues/655","id":123499253,"number":655,"title":"Widgets centered on first frame","user":{"login":"bvssvni","id":1743862,"avatar_url":"https://avatars.githubusercontent.com/u/1743862?v=3","gravatar_id":"","url":"https://api.github.com/users/bvssvni","html_url":"https://github.com/bvssvni","followers_url":"https://api.github.com/users/bvssvni/followers","following_url":"https://api.github.com/users/bvssvni/following{/other_user}","gists_url":"https://api.github.com/users/bvssvni/gists{/gist_id}","starred_url":"https://api.github.com/users/bvssvni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bvssvni/subscriptions","organizations_url":"https://api.github.com/users/bvssvni/orgs","repos_url":"https://api.github.com/users/bvssvni/repos","events_url":"https://api.github.com/users/bvssvni/events{/privacy}","received_events_url":"https://api.github.com/users/bvssvni/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/PistonDevelopers/conrod/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-22T15:17:10Z","updated_at":"2015-12-22T16:02:54Z","closed_at":null,"body":"In Turbine, when starting the application the widgets seems to be centered at the first frame, and then corrected at later frames.\r\n\r\nCode:\r\n\r\n```Rust\r\n        if !capture_cursor {\r\n            use conrod::*;\r\n            \r\n            ui.handle_event(&e);\r\n            e.update(|_| ui.set_widgets(|ui| {\r\n                Button::new()\r\n                    .color(color::blue())\r\n                    .top_left()\r\n                    .w_h(60.0, 30.0)\r\n                    .label(\"refresh\")\r\n                    .react(|| {})\r\n                    .set(REFRESH, ui);\r\n            }));\r\n            e.draw_2d(|c, g| {\r\n                ui.draw(c, g);\r\n            });\r\n        }\r\n```"},"comment":{"url":"https://api.github.com/repos/PistonDevelopers/conrod/issues/comments/166658452","html_url":"https://github.com/PistonDevelopers/conrod/issues/655#issuecomment-166658452","issue_url":"https://api.github.com/repos/PistonDevelopers/conrod/issues/655","id":166658452,"user":{"login":"bvssvni","id":1743862,"avatar_url":"https://avatars.githubusercontent.com/u/1743862?v=3","gravatar_id":"","url":"https://api.github.com/users/bvssvni","html_url":"https://github.com/bvssvni","followers_url":"https://api.github.com/users/bvssvni/followers","following_url":"https://api.github.com/users/bvssvni/following{/other_user}","gists_url":"https://api.github.com/users/bvssvni/gists{/gist_id}","starred_url":"https://api.github.com/users/bvssvni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bvssvni/subscriptions","organizations_url":"https://api.github.com/users/bvssvni/orgs","repos_url":"https://api.github.com/users/bvssvni/repos","events_url":"https://api.github.com/users/bvssvni/events{/privacy}","received_events_url":"https://api.github.com/users/bvssvni/received_events","type":"User","site_admin":false},"created_at":"2015-12-22T16:02:54Z","updated_at":"2015-12-22T16:02:54Z","body":"Printing out rectangle and color in `draw_from_container`:\r\n\r\n```Rust\r\n        primitive::shape::framed_rectangle::KIND => {\r\n            if let Some(framed_rectangle) = container.unique_widget_state::<::FramedRectangle>() {\r\n                let frame = framed_rectangle.style.get_frame(theme);\r\n                if frame > 0.0 {\r\n                    let frame_color = framed_rectangle.style.get_frame_color(theme);\r\n                    let frame_rect = container.rect;\r\n                    draw_rectangle(context, graphics, frame_rect, frame_color);\r\n                }\r\n                let color = framed_rectangle.style.get_color(theme);\r\n                let rect = container.rect.pad(frame);\r\n\r\n                static mut i: u32 = 0;\r\n                println!(\"{:?}\", rect);\r\n                println!(\"{:?}\", color);\r\n                unsafe { i += 1; if i > 5 { panic!(\"\"); } }\r\n                draw_rectangle(context, graphics, rect, color);\r\n            }\r\n        },\r\n```\r\n\r\nGetting:\r\n\r\n```\r\nRect { x: Range { start: 0, end: 0 }, y: Range { start: 0, end: 0 } }\r\nRgba(0, 0, 0, 0)\r\nRect { x: Range { start: 1, end: 59 }, y: Range { start: -29, end: -1 } }\r\nRgba(0.28509036, 0.41999847, 0.66608846, 1)\r\nRect { x: Range { start: -512, end: 512 }, y: Range { start: -384, end: 384 } }\r\nRgba(0, 0, 0, 0)\r\nRect { x: Range { start: -511, end: -453 }, y: Range { start: 355, end: 383 } }\r\nRgba(0.20392157, 0.39607844, 0.6431373, 1)\r\nRect { x: Range { start: -512, end: 512 }, y: Range { start: -384, end: 384 } }\r\nRgba(0, 0, 0, 0)\r\nRect { x: Range { start: -511, end: -453 }, y: Range { start: 355, end: 383 } }\r\nRgba(0.20392157, 0.39607844, 0.6431373, 1)\r\nthread '<main>' panicked at '', /Users/sven/rust/conrod/./src/backend/graphics.rs:206\r\n```"}}