Skip to content
Snippets Groups Projects
Commit d65e371f authored by MrGVSV's avatar MrGVSV
Browse files

Fixed UV coordinates

Swapped Y-directions. This fixes issues with border_radius not lining up
properly
parent e6e83b5c
No related branches found
No related tags found
No related merge requests found
......@@ -37,9 +37,9 @@ use kayak_font::{
KayakFont,
};
use kayak_core::styles::Corner;
use super::{Dpi, UNIFIED_SHADER_HANDLE};
use crate::{render::ui_pass::TransparentUI, WindowSize};
use kayak_core::styles::Corner;
pub struct UnifiedPipeline {
view_layout: BindGroupLayout,
......@@ -52,12 +52,12 @@ pub struct UnifiedPipeline {
}
const QUAD_VERTEX_POSITIONS: &[Vec3] = &[
const_vec3!([0.0, 0.0, 0.0]),
const_vec3!([1.0, 1.0, 0.0]),
const_vec3!([0.0, 1.0, 0.0]),
const_vec3!([0.0, 0.0, 0.0]),
const_vec3!([1.0, 0.0, 0.0]),
const_vec3!([0.0, 0.0, 0.0]),
const_vec3!([0.0, 1.0, 0.0]),
const_vec3!([1.0, 1.0, 0.0]),
const_vec3!([1.0, 0.0, 0.0]),
];
impl FontRenderingPipeline for UnifiedPipeline {
......@@ -412,27 +412,27 @@ pub fn prepare_quads(
let bottom_left = Vec4::new(
uv_min.x,
uv_max.y,
uv_min.y,
extracted_sprite.char_id as f32,
extracted_sprite.border_radius.top_left,
extracted_sprite.border_radius.bottom_left,
);
let top_left = Vec4::new(
uv_min.x,
uv_min.y,
uv_max.y,
extracted_sprite.char_id as f32,
extracted_sprite.border_radius.bottom_left,
extracted_sprite.border_radius.top_left,
);
let top_right = Vec4::new(
uv_max.x,
uv_min.y,
uv_max.y,
extracted_sprite.char_id as f32,
extracted_sprite.border_radius.bottom_right,
extracted_sprite.border_radius.top_right,
);
let bottom_right = Vec4::new(
uv_max.x,
uv_max.y,
uv_min.y,
extracted_sprite.char_id as f32,
extracted_sprite.border_radius.top_right,
extracted_sprite.border_radius.bottom_right,
);
let uvs: [[f32; 4]; 6] = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment