Skip to content
Snippets Groups Projects
Commit ecc7f8df authored by Stephen D's avatar Stephen D
Browse files

fix rendering bug w/ chat bounding boxes

parent f237bcaf
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,6 @@ use embedded_graphics::{
};
use embedded_text::{style::TextBoxStyleBuilder, TextBox};
use heapless::String;
use rtt_target::rdbg;
use crate::{
app::WIDTH,
......@@ -106,7 +105,7 @@ fn calculate_bounding_box<S: TextRenderer>(tb: &TextBox<'_, S>) -> Rectangle {
let mut max_x = 0;
let mut y = 1;
for c in tb.text.chars() {
if c == '\n' || x >= CHAR_WIDTH * tb.bounds.size.width {
if c == '\n' || CHAR_WIDTH * x >= tb.bounds.size.width {
x = 0;
y += 1;
} else {
......
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