2022-10-05 10:49:58 -07:00
|
|
|
/// A colored rectangle with a border.
|
|
|
|
|
///
|
|
|
|
|
/// This type can be directly uploaded to GPU memory.
|
|
|
|
|
#[derive(Debug, Clone, Copy)]
|
|
|
|
|
#[repr(C)]
|
|
|
|
|
pub struct Quad {
|
|
|
|
|
/// The position of the [`Quad`].
|
|
|
|
|
pub position: [f32; 2],
|
|
|
|
|
|
|
|
|
|
/// The size of the [`Quad`].
|
|
|
|
|
pub size: [f32; 2],
|
|
|
|
|
|
|
|
|
|
/// The color of the [`Quad`], in __linear RGB__.
|
|
|
|
|
pub color: [f32; 4],
|
|
|
|
|
|
|
|
|
|
/// The border color of the [`Quad`], in __linear RGB__.
|
|
|
|
|
pub border_color: [f32; 4],
|
|
|
|
|
|
|
|
|
|
/// The border radius of the [`Quad`].
|
2022-11-03 00:35:01 +01:00
|
|
|
pub border_radius: [f32; 4],
|
2022-10-05 10:49:58 -07:00
|
|
|
|
|
|
|
|
/// The border width of the [`Quad`].
|
|
|
|
|
pub border_width: f32,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[allow(unsafe_code)]
|
|
|
|
|
unsafe impl bytemuck::Zeroable for Quad {}
|
|
|
|
|
|
|
|
|
|
#[allow(unsafe_code)]
|
2022-10-06 07:28:05 -07:00
|
|
|
unsafe impl bytemuck::Pod for Quad {}
|