|
|
|
|
@ -40,8 +40,8 @@ struct ModifierKeys { |
|
|
|
|
fn draw(canvas: &mut Canvas<Window>, |
|
|
|
|
window_size: (u32, u32), |
|
|
|
|
glyph_atlas: &GlyphAtlas, |
|
|
|
|
text: &str, |
|
|
|
|
pos: usize) -> Result<(), String> { |
|
|
|
|
buffer: &str, |
|
|
|
|
cursor_position: usize) -> Result<(), String> { |
|
|
|
|
let text_offset = Point::new(10, 10); |
|
|
|
|
// Draw background
|
|
|
|
|
canvas.set_draw_color(Color::RGB(32, 32, 32)); |
|
|
|
|
@ -52,13 +52,13 @@ fn draw(canvas: &mut Canvas<Window>, |
|
|
|
|
let fb_text = editor_render::draw_text( |
|
|
|
|
&glyph_atlas.glyphs, |
|
|
|
|
&glyph_atlas.metrics, |
|
|
|
|
text, |
|
|
|
|
buffer, |
|
|
|
|
text_offset |
|
|
|
|
); |
|
|
|
|
canvas.draw_points(&fb_text[..])?; |
|
|
|
|
|
|
|
|
|
// Draw info
|
|
|
|
|
let status = text.len().to_formatted_string(&Locale::en); |
|
|
|
|
let status = buffer.len().to_formatted_string(&Locale::en); |
|
|
|
|
let status_position = Point::new( |
|
|
|
|
text_offset.x, |
|
|
|
|
window_size.1 as i32 - glyph_atlas.metrics.height as i32 * 2 |
|
|
|
|
@ -84,8 +84,8 @@ fn draw(canvas: &mut Canvas<Window>, |
|
|
|
|
canvas.set_draw_color(Color::RGB(64, 240, 240)); |
|
|
|
|
let fb_cursor = editor_render::draw_cursor( |
|
|
|
|
&glyph_atlas.metrics, |
|
|
|
|
pos, |
|
|
|
|
text, |
|
|
|
|
cursor_position, |
|
|
|
|
buffer, |
|
|
|
|
text_offset |
|
|
|
|
); |
|
|
|
|
canvas.draw_line(fb_cursor.0, fb_cursor.1)?; |
|
|
|
|
|