From 4a11cbd99445338619dfaf1f327dbc25b2983cb7 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 25 Oct 2021 16:16:35 +0700 Subject: Implement `Widget::mouse_interaction` for `PaneGrid` ... and fix rendering of drag interaction in `PaneGrid` by introducing an explicit `with_translation` method to `Renderer` and simplifying the `with_layer` and `Clip` primitive. --- native/src/renderer.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'native/src/renderer.rs') diff --git a/native/src/renderer.rs b/native/src/renderer.rs index e48c701d..6d12edae 100644 --- a/native/src/renderer.rs +++ b/native/src/renderer.rs @@ -46,10 +46,11 @@ pub trait Renderer: Sized { element.layout(self, limits) } - fn with_layer( + fn with_layer(&mut self, bounds: Rectangle, f: impl FnOnce(&mut Self)); + + fn with_translation( &mut self, - bounds: Rectangle, - offset: Vector, + translation: Vector, f: impl FnOnce(&mut Self), ); -- cgit