Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop visual artifacts from appearing when using input fields #2381

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ You can find its changes [documented below](#083---2023-02-28).

- `syn` feature `extra-traits` is now always enabled. ([#2375] by [@AtomicGamer9523])
- Title bar color was opposite of the system theme on Windows. ([#2378] by [@Insprill])
- Input field focus would cause visual artifacts (grey rectangles) to be drawn when focus changed ([#2381] by [@matthewgapp])

### Visual

Expand Down
15 changes: 7 additions & 8 deletions druid/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,15 +445,14 @@ impl<T: Data> Window<T> {
self.layout(queue, data, env);
}

let reset_color = if self.transparent {
Color::TRANSPARENT
} else {
env.get(crate::theme::WINDOW_BACKGROUND_COLOR)
};

for &r in invalid.rects() {
piet.clear(
Some(r),
if self.transparent {
Color::TRANSPARENT
} else {
env.get(crate::theme::WINDOW_BACKGROUND_COLOR)
},
);
piet.fill(r, &reset_color);
}
self.paint(piet, invalid, queue, data, env);
}
Expand Down