linebender / linebender/druid

Scrollbar animation causing full-frame refresh

Open
#2,205 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
9.7k
Forks
565
PR merge metrics
No merged PRs in 30d

Description

Further to [this Zulip topic](https://xi.zulipchat.com/#narrow/stream/255910-druid-help/topic/Scroll.20in.20Either.20unexpected.20behaviour), I have an example where the scrollbar fade animation of a `Scroll` inside of an `Either` is causing another widget to paint. The problem is fixed by removing the Either wrapper. I'm using the master branch and running on Ubuntu 20.04.
```rust
use druid::widget::{Either, Flex, Painter, Scroll};
use druid::{AppLauncher, Data, WidgetExt, WindowDesc};

#[derive(Clone, Data)]
struct AppData;

fn main() {
let widget = Flex::row()
.with_child(Either::new(
|_, _| true,
Scroll::new(Flex::column().fix_size(300., 9999.)),
Flex::column(),
))
.with_child(Painter::new(|_, _, _| println!("paints")));
let window = WindowDesc::new(widget);
AppLauncher::with_window(window).launch(AppData {}).unwrap();
}
```
Cargo.toml
```toml
[package]
name = "rust_playground"
version = "0.1.0"
edition = "2021"

[dependencies]
druid = { git = "https://github.com/linebender/druid" }
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided Rust reproduction on Ubuntu 20.04, focusing on the Scroll inside Either and the neighboring Painter. Trace the scrollbar fade animation and painting behavior; done means the sibling Painter is not repainted during the scrollbar animation while the Scroll remains inside Either.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.