@@ -11,10 +11,10 @@ use bevy_render::{
11
11
use bevy_sprite:: { TextureAtlas , QUAD_HANDLE } ;
12
12
use bevy_transform:: prelude:: { GlobalTransform , Transform } ;
13
13
use bevy_window:: Windows ;
14
- use glyph_brush_layout:: { HorizontalAlign , VerticalAlign } ;
15
14
16
15
use crate :: {
17
- CalculatedSize , DefaultTextPipeline , DrawableText , Font , FontAtlasSet , Text , TextError ,
16
+ CalculatedSize , DefaultTextPipeline , DrawableText , Font , FontAtlasSet , HorizontalAlign , Text ,
17
+ TextError , VerticalAlign ,
18
18
} ;
19
19
20
20
/// The bundle of components needed to draw text in a 2D scene via the Camera2dBundle.
@@ -90,12 +90,12 @@ pub fn draw_text2d_system(
90
90
91
91
if let Some ( text_glyphs) = text_pipeline. get_glyphs ( & entity) {
92
92
let position = global_transform. translation
93
- + match text. alignment . vertical . into ( ) {
93
+ + match text. alignment . vertical {
94
94
VerticalAlign :: Top => Vec3 :: zero ( ) ,
95
95
VerticalAlign :: Center => Vec3 :: new ( 0.0 , -height * 0.5 , 0.0 ) ,
96
96
VerticalAlign :: Bottom => Vec3 :: new ( 0.0 , -height, 0.0 ) ,
97
97
}
98
- + match text. alignment . horizontal . into ( ) {
98
+ + match text. alignment . horizontal {
99
99
HorizontalAlign :: Left => Vec3 :: new ( -width, 0.0 , 0.0 ) ,
100
100
HorizontalAlign :: Center => Vec3 :: new ( -width * 0.5 , 0.0 , 0.0 ) ,
101
101
HorizontalAlign :: Right => Vec3 :: zero ( ) ,
0 commit comments