fix comment line spacing, add comments to first level

This commit is contained in:
Crispy 2025-03-29 00:48:14 +01:00
parent cd51c4b47a
commit ae42cd10a4
3 changed files with 18 additions and 6 deletions

View file

@ -73,11 +73,16 @@ impl Board {
pub fn draw_comments(&self, d: &mut RaylibDrawHandle, offset: Vector2, scale: f32) {
let tile_size = (TILE_TEXTURE_SIZE * scale) as i32;
let font_size = 10 * (scale as i32).max(1);
let line_space = 12 * (scale as i32).max(1);
for c in &self.comments {
let px = c.x * tile_size + offset.x as i32;
let py = c.y * tile_size + offset.y as i32;
d.draw_text(&c.text, px, py, 10 * scale as i32, Color::ORANGE);
for comment in &self.comments {
let x = comment.x * tile_size + offset.x as i32;
let y = comment.y * tile_size + offset.y as i32;
for (i, line) in comment.text.lines().enumerate() {
let y = y + line_space * i as i32;
d.draw_text(&line, x, y, font_size, Color::ORANGE);
}
}
}

View file

@ -146,7 +146,7 @@ impl Editor {
machine,
sim_state: SimState::Editing,
view_offset: Vector2::zero(),
zoom: 1.,
zoom: 2.,
active_tool: Tool::None,
output_as_text,
input_as_text,