diff options
| author | 2021-10-25 16:16:35 +0700 | |
|---|---|---|
| committer | 2021-10-25 16:35:02 +0700 | |
| commit | 4a11cbd99445338619dfaf1f327dbc25b2983cb7 (patch) | |
| tree | 254598ff97f17cb33e44bd1402323d3b6892cb6b /native/src/widget/text_input.rs | |
| parent | 41394b4e90a81a43c796c070e706e6aa4d8652bc (diff) | |
| download | iced-4a11cbd99445338619dfaf1f327dbc25b2983cb7.tar.gz iced-4a11cbd99445338619dfaf1f327dbc25b2983cb7.tar.bz2 iced-4a11cbd99445338619dfaf1f327dbc25b2983cb7.zip | |
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.
Diffstat (limited to 'native/src/widget/text_input.rs')
| -rw-r--r-- | native/src/widget/text_input.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/native/src/widget/text_input.rs b/native/src/widget/text_input.rs index 0a2b19a3..c2950db9 100644 --- a/native/src/widget/text_input.rs +++ b/native/src/widget/text_input.rs @@ -751,11 +751,9 @@ where }; if text_width > text_bounds.width { - renderer.with_layer( - text_bounds, - Vector::new(offset as u32, 0), - render, - ); + renderer.with_layer(text_bounds, |renderer| { + renderer.with_translation(Vector::new(-offset, 0.0), render) + }); } else { render(renderer); } |
