Skip to content
Snippets Groups Projects
Commit 9ca2b007 authored by StarToaster's avatar StarToaster
Browse files

Fix formatting issues.

parent 41e732c8
No related branches found
No related tags found
No related merge requests found
......@@ -16,8 +16,8 @@ use kayak_font::KayakFont;
pub mod font;
pub mod image;
mod nine_patch;
mod texture_atlas;
mod quad;
mod texture_atlas;
pub struct BevyKayakUIExtractPlugin;
......@@ -81,8 +81,12 @@ pub fn extract(
extracted_quads.extend(nine_patch_quads);
}
RenderPrimitive::TextureAtlas { .. } => {
let texture_atlas_quads =
texture_atlas::extract_texture_atlas(&render_primitive, &image_manager, &images, dpi);
let texture_atlas_quads = texture_atlas::extract_texture_atlas(
&render_primitive,
&image_manager,
&images,
dpi,
);
extracted_quads.extend(texture_atlas_quads);
}
RenderPrimitive::Clip { layout } => {
......
......@@ -21,8 +21,8 @@ pub fn extract_texture_atlas(
let (size, position, layout, handle) = match render_primitive {
RenderPrimitive::TextureAtlas {
size,
position,
size,
position,
layout,
handle,
} => (size, position, layout, handle),
......@@ -57,21 +57,21 @@ pub fn extract_texture_atlas(
},
uv_min: Some(Vec2::new(
position.0 / image_size.x,
1.0 - ((position.1 + size.1) / image_size.y)
1.0 - ((position.1 + size.1) / image_size.y),
)),
uv_max: Some(Vec2::new(
(position.0 + size.0) / image_size.x,
1.0 - (position.1 / image_size.y),
)),
color: Color::WHITE,
vertex_index: 0,
char_id: 0,
z_index: layout.z_index,
font_handle: None,
quad_type: UIQuadType::Image,
type_index: 0,
border_radius: Corner::default(),
image: image_handle,
color: Color::WHITE,
vertex_index: 0,
char_id: 0,
z_index: layout.z_index,
font_handle: None,
quad_type: UIQuadType::Image,
type_index: 0,
border_radius: Corner::default(),
image: image_handle,
},
};
extracted_quads.push(quad);
......
......@@ -105,7 +105,11 @@ impl From<&Style> for RenderPrimitive {
layout: Rect::default(),
handle,
},
RenderCommand::TextureAtlas { handle, size, position, } => Self::TextureAtlas {
RenderCommand::TextureAtlas {
handle,
size,
position,
} => Self::TextureAtlas {
handle,
layout: Rect::default(),
size,
......
......@@ -399,7 +399,7 @@ impl Style {
impl Add for Style {
type Output = Style;
/// Defines the `+` operator for [`Style`]. This is a convenience wrapper of the `self.with_style()` method and useful for concatenating many small `Style` variables.
/// Defines the `+` operator for [`Style`]. This is a convenience wrapper of the `self.with_style()` method and useful for concatenating many small `Style` variables.
/// Similar to `with_style()` In a `StyleA + StyleB` operation, values from `StyleB` are applied to any field of StyleA that are marked as [`StyleProp::Unset`].
///
/// Note: since the changes are applied only to unset fields, addition is *not* commutative. This means StyleA + StyleB != StyleB + StyleA for most cases.
......
......@@ -195,10 +195,7 @@ impl FontTextureCache {
texture,
sampler,
texture_view,
size: Vec2 {
x: 1.0,
y: 1.0,
},
size: Vec2 { x: 1.0, y: 1.0 },
texture_format: TextureFormat::Rgba8Unorm,
};
......
......@@ -8,12 +8,12 @@ mod if_element;
mod image;
mod inspector;
mod nine_patch;
mod texture_atlas;
mod on_change;
mod scroll;
mod spin_box;
mod text;
mod text_box;
mod texture_atlas;
mod tooltip;
mod window;
......@@ -27,11 +27,11 @@ pub use if_element::*;
pub use image::*;
pub use inspector::*;
pub use nine_patch::*;
pub use texture_atlas::*;
pub use on_change::*;
pub use scroll::*;
pub use spin_box::*;
pub use text::*;
pub use text_box::*;
pub use texture_atlas::*;
pub use tooltip::*;
pub use window::*;
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