summaryrefslogtreecommitdiffstats
path: root/native/src/widget/scrollable.rs
diff options
context:
space:
mode:
Diffstat (limited to 'native/src/widget/scrollable.rs')
-rw-r--r--native/src/widget/scrollable.rs25
1 files changed, 15 insertions, 10 deletions
diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs
index 76badbde..563ea370 100644
--- a/native/src/widget/scrollable.rs
+++ b/native/src/widget/scrollable.rs
@@ -485,15 +485,20 @@ where
};
if let Some(scrollbar) = scrollbar {
- renderer.with_layer(bounds, Vector::new(0, offset), |renderer| {
- self.content.draw(
- renderer,
- style,
- content_layout,
- cursor_position,
- &Rectangle {
- y: bounds.y + offset as f32,
- ..bounds
+ renderer.with_layer(bounds, |renderer| {
+ renderer.with_translation(
+ Vector::new(0.0, -(offset as f32)),
+ |renderer| {
+ self.content.draw(
+ renderer,
+ style,
+ content_layout,
+ cursor_position,
+ &Rectangle {
+ y: bounds.y + offset as f32,
+ ..bounds
+ },
+ );
},
);
});
@@ -509,7 +514,7 @@ where
let is_scrollbar_visible =
style.background.is_some() || style.border_width > 0.0;
- renderer.with_layer(bounds, Vector::new(0, 0), |renderer| {
+ renderer.with_layer(bounds, |renderer| {
if is_scrollbar_visible {
renderer.fill_rectangle(renderer::Quad {
bounds: scrollbar.bounds,