|
|
@ -13,6 +13,7 @@ pub use caching_shaper::CachingShaper;
|
|
|
|
use cursor_renderer::CursorRenderer;
|
|
|
|
use cursor_renderer::CursorRenderer;
|
|
|
|
use crate::editor::{EDITOR, Style};
|
|
|
|
use crate::editor::{EDITOR, Style};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pub struct Renderer {
|
|
|
|
pub struct Renderer {
|
|
|
|
surface: Option<Surface>,
|
|
|
|
surface: Option<Surface>,
|
|
|
|
paint: Paint,
|
|
|
|
paint: Paint,
|
|
|
@ -107,7 +108,9 @@ impl Renderer {
|
|
|
|
canvas.restore();
|
|
|
|
canvas.restore();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn draw(&mut self, gpu_canvas: &mut Canvas, coordinate_system_helper: &CoordinateSystemHelper) -> bool {
|
|
|
|
pub fn draw(&mut self, gpu_canvas: &mut Canvas,
|
|
|
|
|
|
|
|
coordinate_system_helper: &CoordinateSystemHelper,
|
|
|
|
|
|
|
|
dt: f32) -> bool {
|
|
|
|
trace!("Rendering");
|
|
|
|
trace!("Rendering");
|
|
|
|
let ((draw_commands, should_clear), default_style, cursor, font_name, font_size) = {
|
|
|
|
let ((draw_commands, should_clear), default_style, cursor, font_name, font_size) = {
|
|
|
|
let mut editor = EDITOR.lock();
|
|
|
|
let mut editor = EDITOR.lock();
|
|
|
@ -162,7 +165,7 @@ impl Renderer {
|
|
|
|
self.cursor_renderer.draw(
|
|
|
|
self.cursor_renderer.draw(
|
|
|
|
cursor, &default_style.colors,
|
|
|
|
cursor, &default_style.colors,
|
|
|
|
self.font_width, self.font_height,
|
|
|
|
self.font_width, self.font_height,
|
|
|
|
&mut self.shaper, gpu_canvas);
|
|
|
|
&mut self.shaper, gpu_canvas, dt);
|
|
|
|
|
|
|
|
|
|
|
|
font_changed
|
|
|
|
font_changed
|
|
|
|
}
|
|
|
|
}
|
|
|
|