Skip to content

Commit

Permalink
actually wrap text correctly
Browse files Browse the repository at this point in the history
too much magic numbers. bad amy
  • Loading branch information
tomara-x committed May 8, 2024
1 parent 19b6346 commit a2dfd06
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/circles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,11 +507,12 @@ pub fn update_info_text(
mut white_hole_query: Query<&mut WhiteHole>,
black_hole_query: Query<&BlackHole>,
mut color_query: Query<&mut Col>,
text_size: Res<TextSize>,
) {
for (id, info) in query.iter_mut() {
let t = trans_query.get_mut(id).unwrap();
if t.is_changed() || info.is_added() {
text_bounds.get_mut(info.0).unwrap().size.x = t.scale.x * 10.;
if t.is_changed() || info.is_added() || text_size.is_changed() {
text_bounds.get_mut(info.0).unwrap().size.x = t.scale.x * (1.2/text_size.0);
let t = t.translation;
trans_query.get_mut(info.0).unwrap().translation = t.xy().extend(t.z + 0.00001);
}
Expand Down

0 comments on commit a2dfd06

Please sign in to comment.