diff options
Diffstat (limited to 'src/display.rs')
-rw-r--r-- | src/display.rs | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/display.rs b/src/display.rs index c2636e7e..73bb0fce 100644 --- a/src/display.rs +++ b/src/display.rs @@ -149,7 +149,7 @@ impl Display { let rasterizer = font::Rasterizer::new(dpi.x(), dpi.y(), dpr, config.use_thin_strokes())?; // Create renderer - let mut renderer = QuadRenderer::new(size)?; + let mut renderer = QuadRenderer::new(&config, size)?; // Initialize glyph cache let glyph_cache = { @@ -182,15 +182,21 @@ impl Display { let size = Size { width: Pixels(width), height: Pixels(height) }; info!("set_inner_size: {}", size); - window.set_inner_size(size); - renderer.resize(*size.width as _, *size.height as _); + let viewport_size = Size { + width: Pixels(width + 2 * config.padding().x as u32), + height: Pixels(width + 2 * config.padding().y as u32), + }; + window.set_inner_size(&viewport_size); + renderer.resize(viewport_size.width.0 as _, viewport_size.height.0 as _); info!("Cell Size: ({} x {})", cell_width, cell_height); let size_info = SizeInfo { - width: *size.width as f32, - height: *size.height as f32, + width: viewport_size.width.0 as f32, + height: viewport_size.height.0 as f32, cell_width: cell_width as f32, - cell_height: cell_height as f32 + cell_height: cell_height as f32, + padding_x: config.padding().x.floor(), + padding_y: config.padding().y.floor(), }; // Channel for resize events |