From ee29cae6a2b9884d05b53fc169c86aa264778e83 Mon Sep 17 00:00:00 2001 From: StarArawn <toasterthegamer@gmail.com> Date: Sat, 11 Dec 2021 11:27:12 -0500 Subject: [PATCH] Fixed missing layout stuff. --- Cargo.lock | 2 ++ bevy_kayak_ui/src/render/unified/font/extract.rs | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 91cc95e..1379131 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1900,6 +1900,8 @@ version = "0.1.0" dependencies = [ "anyhow", "bevy", + "bytemuck", + "crevice", "serde", "serde_json", "serde_path_to_error", diff --git a/bevy_kayak_ui/src/render/unified/font/extract.rs b/bevy_kayak_ui/src/render/unified/font/extract.rs index c4d7fbe..3e609e6 100644 --- a/bevy_kayak_ui/src/render/unified/font/extract.rs +++ b/bevy_kayak_ui/src/render/unified/font/extract.rs @@ -4,7 +4,7 @@ use bevy::{ sprite2::Rect, }; use kayak_core::render_primitive::RenderPrimitive; -use kayak_font::KayakFont; +use kayak_font::{CoordinateSystem, KayakFont}; use crate::{ render::unified::pipeline::{ExtractQuadBundle, ExtractedQuad, UIQuadType}, @@ -52,8 +52,12 @@ pub fn extract_texts( let font = font.unwrap(); - let chars_layouts = - font.get_layout(Vec2::new(layout.posx, layout.posy), content, font_size); + let chars_layouts = font.get_layout( + CoordinateSystem::PositiveYDown, + Vec2::new(layout.posx, layout.posy), + content, + font_size, + ); for char_layout in chars_layouts { extracted_texts.push(ExtractQuadBundle { -- GitLab