From 5cfb948b2b30bfb1a24f999198ba3ef1d0322f78 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Fri, 20 Aug 2021 10:01:24 -0700 Subject: [PATCH] Make the default window size non-zero Co-Authored-By: Antonio Scandurra --- gpui/src/platform.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gpui/src/platform.rs b/gpui/src/platform.rs index 05c03811fe..f6930c1ae8 100644 --- a/gpui/src/platform.rs +++ b/gpui/src/platform.rs @@ -13,7 +13,7 @@ use crate::{ fonts::{FontId, GlyphId, Metrics as FontMetrics, Properties as FontProperties}, geometry::{ rect::{RectF, RectI}, - vector::Vector2F, + vector::{vec2f, Vector2F}, }, text_layout::LineLayout, ClipboardItem, Menu, Scene, @@ -96,7 +96,6 @@ pub trait WindowContext { fn present_scene(&mut self, scene: Scene); } -#[derive(Default)] pub struct WindowOptions<'a> { pub bounds: RectF, pub title: Option<&'a str>, @@ -141,3 +140,13 @@ pub trait FontSystem: Send + Sync { ) -> LineLayout; fn wrap_line(&self, text: &str, font_id: FontId, font_size: f32, width: f32) -> Vec; } + +impl<'a> Default for WindowOptions<'a> { + fn default() -> Self { + Self { + bounds: RectF::new(Default::default(), vec2f(1024.0, 768.0)), + title: Default::default(), + titlebar_appears_transparent: Default::default(), + } + } +}