summaryrefslogtreecommitdiffstats
path: root/widget/src/pane_grid.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2024-02-02 14:54:56 +0100
committerLibravatar GitHub <noreply@github.com>2024-02-02 14:54:56 +0100
commitaea172543cb49f1f1e3625f60b49336f59e26c00 (patch)
treee99e7a55873678ac37fd695a0f46c1350b30dd2f /widget/src/pane_grid.rs
parent759f0e922598504705b543185bc7140a652b726a (diff)
parentb3adf3184594c9bf60e0548a0362d30c512f3966 (diff)
downloadiced-aea172543cb49f1f1e3625f60b49336f59e26c00.tar.gz
iced-aea172543cb49f1f1e3625f60b49336f59e26c00.tar.bz2
iced-aea172543cb49f1f1e3625f60b49336f59e26c00.zip
Merge pull request #2120 from iced-rs/transform-primitive
`Transform` primitive
Diffstat (limited to '')
-rw-r--r--widget/src/pane_grid.rs31
1 files changed, 15 insertions, 16 deletions
diff --git a/widget/src/pane_grid.rs b/widget/src/pane_grid.rs
index f76c6088..4f9a265a 100644
--- a/widget/src/pane_grid.rs
+++ b/widget/src/pane_grid.rs
@@ -962,22 +962,21 @@ pub fn draw<Theme, Renderer, T>(
if let Some(cursor_position) = cursor.position() {
let bounds = layout.bounds();
- renderer.with_translation(
- cursor_position
- - Point::new(bounds.x + origin.x, bounds.y + origin.y),
- |renderer| {
- renderer.with_layer(bounds, |renderer| {
- draw_pane(
- pane,
- renderer,
- default_style,
- layout,
- pane_cursor,
- viewport,
- );
- });
- },
- );
+ let translation = cursor_position
+ - Point::new(bounds.x + origin.x, bounds.y + origin.y);
+
+ renderer.with_translation(translation, |renderer| {
+ renderer.with_layer(bounds, |renderer| {
+ draw_pane(
+ pane,
+ renderer,
+ default_style,
+ layout,
+ pane_cursor,
+ viewport,
+ );
+ });
+ });
}
}