Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions comfy-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ pub struct RawDrawParams {
pub pivot: Option<Vec2>,
}

const WHITE_ARRAY: [f32; 4] = [1.0, 1.0, 1.0, 1.0];
const WHITE_ARRAY: [u8; 4] = [255, 255, 255, 255];

pub const QUAD_VERTICES: &[SpriteVertex] = &[
SpriteVertex {
Expand Down Expand Up @@ -620,15 +620,15 @@ pub struct Mesh {
pub struct SpriteVertex {
pub position: [f32; 3],
pub tex_coords: [f32; 2],
pub color: [f32; 4],
pub color: [u8; 4],
}

impl SpriteVertex {
pub fn new(position: Vec3, tex_coords: Vec2, color: Color) -> Self {
Self {
position: [position.x, position.y, position.z],
tex_coords: [tex_coords.x, tex_coords.y],
color: [color.r, color.g, color.b, color.a],
color: color.to_array(),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion comfy-wgpu/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub trait Vertex {
const ATTRIBS: [wgpu::VertexAttribute; 3] = wgpu::vertex_attr_array![
0 => Float32x3,
1 => Float32x2,
2 => Float32x4,
2 => Unorm8x4,
];

impl Vertex for SpriteVertex {
Expand Down