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

Make scroll to not reset after every tab switch #710

Closed
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
12 changes: 7 additions & 5 deletions src/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,12 +404,14 @@ impl View for Box<dyn View> {
pub fn default_compute_layout(id: ViewId, cx: &mut ComputeLayoutCx) -> Option<Rect> {
let mut layout_rect: Option<Rect> = None;
for child in id.children() {
if !child.style_has_hidden() {
let child_layout = cx.compute_view_layout(child);
if let Some(child_layout) = child_layout {
if let Some(rect) = layout_rect {
layout_rect = Some(rect.union(child_layout));
} else {
layout_rect = Some(child_layout);
if let Some(child_layout) = child_layout {
if let Some(rect) = layout_rect {
layout_rect = Some(rect.union(child_layout));
} else {
layout_rect = Some(child_layout);
}
}
}
}
Expand Down
Loading