diff --git a/src/renderer.rs b/src/renderer.rs index 0c8e4e57..79ce9fd1 100644 --- a/src/renderer.rs +++ b/src/renderer.rs @@ -113,6 +113,13 @@ impl Renderer { Renderer::TinySkia(r) => r.set_scale(scale), } } + + pub fn scale(&self) -> f64 { + match self { + Renderer::Vger(r) => r.scale(), + Renderer::TinySkia(r) => r.scale(), + } + } } impl floem_renderer::Renderer for Renderer { diff --git a/tiny_skia/src/lib.rs b/tiny_skia/src/lib.rs index cf690653..0a16e90e 100644 --- a/tiny_skia/src/lib.rs +++ b/tiny_skia/src/lib.rs @@ -102,6 +102,10 @@ impl f64 { + self.scale + } } fn to_color(color: Color) -> tiny_skia::Color { diff --git a/vger/src/lib.rs b/vger/src/lib.rs index 3c604954..c5db9b36 100644 --- a/vger/src/lib.rs +++ b/vger/src/lib.rs @@ -125,6 +125,10 @@ impl VgerRenderer { pub fn set_scale(&mut self, scale: f64) { self.scale = scale; } + + pub fn scale(&self) -> f64 { + self.scale + } } impl VgerRenderer {