From 006530a1f515427d99dd0155b996c33f822874bc Mon Sep 17 00:00:00 2001 From: bunnie Date: Thu, 19 Oct 2023 22:39:06 +0800 Subject: [PATCH] make the default style for the text box something API-level accessible this allows other functions to lay out based on the default style without having to guess it. --- services/graphics-server/src/api/text.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/graphics-server/src/api/text.rs b/services/graphics-server/src/api/text.rs index a8b1b5717..75b32bfa1 100644 --- a/services/graphics-server/src/api/text.rs +++ b/services/graphics-server/src/api/text.rs @@ -79,6 +79,7 @@ impl From for TextOp { // roughly 168 bytes to represent the rest of the struct, and we want to fill out the 4096 byte page with text const TEXTVIEW_LEN: usize = 3072; +const TEXTVIEW_DEFAULT_STYLE: GlyphStyle = GlyphStyle::Regular; #[derive(Copy, Clone, rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)] pub struct TextView { @@ -129,7 +130,7 @@ impl TextView { clip_rect: None, bounds_hint, bounds_computed: None, - style: GlyphStyle::Regular, + style: TEXTVIEW_DEFAULT_STYLE, text: String::<3072>::new(), cursor: Cursor::new(0, 0, 0), insertion: None,