Skip to content

Commit

Permalink
Fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Davier committed Feb 4, 2021
1 parent abe257d commit 99081c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions crates/bevy_text/src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ impl Text {
/// ```
/// # use bevy_asset::{AssetServer, Handle};
/// # use bevy_render::color::Color;
/// # use bevy_text::{Font, Text, TextAlignment, TextStyle};
/// # use glyph_brush_layout::{HorizontalAlign, VerticalAlign};
/// # use bevy_text::{Font, Text, TextAlignment, TextStyle, HorizontalAlign, VerticalAlign};
/// #
/// # let font_handle: Handle<Font> = Default::default();
/// #
Expand Down
8 changes: 4 additions & 4 deletions crates/bevy_text/src/text2d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ use bevy_render::{
use bevy_sprite::{TextureAtlas, QUAD_HANDLE};
use bevy_transform::prelude::{GlobalTransform, Transform};
use bevy_window::Windows;
use glyph_brush_layout::{HorizontalAlign, VerticalAlign};

use crate::{
CalculatedSize, DefaultTextPipeline, DrawableText, Font, FontAtlasSet, Text, TextError,
CalculatedSize, DefaultTextPipeline, DrawableText, Font, FontAtlasSet, HorizontalAlign, Text,
TextError, VerticalAlign,
};

/// The bundle of components needed to draw text in a 2D scene via the Camera2dBundle.
Expand Down Expand Up @@ -90,12 +90,12 @@ pub fn draw_text2d_system(

if let Some(text_glyphs) = text_pipeline.get_glyphs(&entity) {
let position = global_transform.translation
+ match text.alignment.vertical.into() {
+ match text.alignment.vertical {
VerticalAlign::Top => Vec3::zero(),
VerticalAlign::Center => Vec3::new(0.0, -height * 0.5, 0.0),
VerticalAlign::Bottom => Vec3::new(0.0, -height, 0.0),
}
+ match text.alignment.horizontal.into() {
+ match text.alignment.horizontal {
HorizontalAlign::Left => Vec3::new(-width, 0.0, 0.0),
HorizontalAlign::Center => Vec3::new(-width * 0.5, 0.0, 0.0),
HorizontalAlign::Right => Vec3::zero(),
Expand Down

0 comments on commit 99081c2

Please sign in to comment.