Fixing after rebasing on top of structured settings work

macos-click-through
Jon Valdés 5 years ago
parent 2ad315a507
commit c517f00033

@ -230,7 +230,8 @@ impl CursorRenderer {
pub fn draw(&mut self, pub fn draw(&mut self,
cursor: Cursor, default_colors: &Colors, cursor: Cursor, default_colors: &Colors,
font_width: f32, font_height: f32, font_width: f32, font_height: f32,
shaper: &mut CachingShaper, canvas: &mut Canvas) { shaper: &mut CachingShaper, canvas: &mut Canvas,
dt: f32) {
let render = self.blink_status.update_status(&cursor); let render = self.blink_status.update_status(&cursor);
let mut paint = Paint::new(skulpin::skia_safe::colors::WHITE, None); let mut paint = Paint::new(skulpin::skia_safe::colors::WHITE, None);
@ -287,8 +288,6 @@ impl CursorRenderer {
self.cursor_vfx.restart(center_destination); self.cursor_vfx.restart(center_destination);
} }
let dt = 1.0 / (SETTINGS.get("refresh_rate").read_u16() as f32);
let mut animating = false; let mut animating = false;
if !center_destination.is_zero() { if !center_destination.is_zero() {
for corner in self.corners.iter_mut() { for corner in self.corners.iter_mut() {

@ -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
} }

@ -239,7 +239,10 @@ impl WindowWrapper {
if REDRAW_SCHEDULER.should_draw() || SETTINGS.get::<WindowSettings>().no_idle { if REDRAW_SCHEDULER.should_draw() || SETTINGS.get::<WindowSettings>().no_idle {
let renderer = &mut self.renderer; let renderer = &mut self.renderer;
if self.skulpin_renderer.draw(&self.window, |canvas, coordinate_system_helper| { if self.skulpin_renderer.draw(&self.window, |canvas, coordinate_system_helper| {
if renderer.draw(canvas, coordinate_system_helper) {
let dt = 1.0 / (SETTINGS.get::<WindowSettings>().refresh_rate as f32);
if renderer.draw(canvas, coordinate_system_helper, dt) {
handle_new_grid_size(new_size, &renderer) handle_new_grid_size(new_size, &renderer)
} }
}).is_err() { }).is_err() {

Loading…
Cancel
Save