summaryrefslogtreecommitdiffstats
path: root/widget/src/pane_grid.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-02-02 14:31:17 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-02-02 14:31:17 +0100
commita06682ff420678f7068265191738ab70ebe30b4c (patch)
treef4291eaa9ca54e4b58143492b9b00e7d8f99dae3 /widget/src/pane_grid.rs
parentd8dffa411b8c1bbee538e3b51aae6f768e293789 (diff)
downloadiced-a06682ff420678f7068265191738ab70ebe30b4c.tar.gz
iced-a06682ff420678f7068265191738ab70ebe30b4c.tar.bz2
iced-a06682ff420678f7068265191738ab70ebe30b4c.zip
Use `with_translation` wherever possible
Diffstat (limited to 'widget/src/pane_grid.rs')
-rw-r--r--widget/src/pane_grid.rs29
1 files changed, 13 insertions, 16 deletions
diff --git a/widget/src/pane_grid.rs b/widget/src/pane_grid.rs
index 24389462..4f9a265a 100644
--- a/widget/src/pane_grid.rs
+++ b/widget/src/pane_grid.rs
@@ -43,7 +43,7 @@ use crate::core::widget;
use crate::core::widget::tree::{self, Tree};
use crate::core::{
Clipboard, Element, Layout, Length, Pixels, Point, Rectangle, Shell, Size,
- Transformation, Vector, Widget,
+ Vector, Widget,
};
/// A collection of panes distributed using either vertical or horizontal splits
@@ -965,21 +965,18 @@ pub fn draw<Theme, Renderer, T>(
let translation = cursor_position
- Point::new(bounds.x + origin.x, bounds.y + origin.y);
- renderer.with_transformation(
- Transformation::translate(translation.x, translation.y),
- |renderer| {
- renderer.with_layer(bounds, |renderer| {
- draw_pane(
- pane,
- renderer,
- default_style,
- layout,
- pane_cursor,
- viewport,
- );
- });
- },
- );
+ renderer.with_translation(translation, |renderer| {
+ renderer.with_layer(bounds, |renderer| {
+ draw_pane(
+ pane,
+ renderer,
+ default_style,
+ layout,
+ pane_cursor,
+ viewport,
+ );
+ });
+ });
}
}