fix initial window positioning

macos-click-through
Keith Simmons 3 years ago
parent a527c0ebb7
commit cacde9ec9d

@ -266,9 +266,7 @@ impl Renderer {
} }
root_canvas.clear(self.default_style.colors.background.unwrap().to_color()); root_canvas.clear(self.default_style.colors.background.unwrap().to_color());
root_canvas.save(); root_canvas.save();
root_canvas.reset_matrix(); root_canvas.reset_matrix();
if let Some(root_window) = self.rendered_windows.get(&1) { if let Some(root_window) = self.rendered_windows.get(&1) {

@ -222,10 +222,10 @@ pub fn start_loop(
.unwrap(); .unwrap();
let windowed_context = unsafe { windowed_context.make_current().unwrap() }; let windowed_context = unsafe { windowed_context.make_current().unwrap() };
let skia_renderer = SkiaRenderer::new(&windowed_context); let window = windowed_context.window();
let scale_factor = windowed_context.window().scale_factor(); let scale_factor = windowed_context.window().scale_factor();
let renderer = Renderer::new(batched_draw_command_receiver, scale_factor); let renderer = Renderer::new(batched_draw_command_receiver, scale_factor);
let window = windowed_context.window();
if !window.is_maximized() { if !window.is_maximized() {
window.set_inner_size(get_initial_window_size(( window.set_inner_size(get_initial_window_size((
@ -234,6 +234,10 @@ pub fn start_loop(
))); )));
} }
let saved_inner_size = window.inner_size();
let skia_renderer = SkiaRenderer::new(&windowed_context);
log::info!( log::info!(
"window created (scale_factor: {}, font_size: {}x{})", "window created (scale_factor: {}, font_size: {}x{})",
scale_factor, scale_factor,
@ -241,8 +245,6 @@ pub fn start_loop(
renderer.font_height, renderer.font_height,
); );
let saved_inner_size = window.inner_size();
let mut window_wrapper = GlutinWindowWrapper { let mut window_wrapper = GlutinWindowWrapper {
windowed_context, windowed_context,
skia_renderer, skia_renderer,

Loading…
Cancel
Save