[scroll] remember to expand clip region with the clip_rect_margin

This commit is contained in:
Emil Ernerfeldt 2020-06-03 11:00:14 +02:00
parent 2fa03f9a6c
commit de95209676

View file

@ -96,7 +96,8 @@ impl ScrollArea {
inner_rect.min - state.offset, inner_rect.min - state.offset,
vec2(inner_size.x, f32::INFINITY), vec2(inner_size.x, f32::INFINITY),
)); ));
let mut content_clip_rect = ui.clip_rect().intersect(inner_rect); let mut content_clip_rect = inner_rect.expand(ui.style().clip_rect_margin);
content_clip_rect = content_clip_rect.intersect(ui.clip_rect());
content_clip_rect.max.x = ui.clip_rect().max.x - current_scroll_bar_width; // Nice handling of forced resizing beyond the possible content_clip_rect.max.x = ui.clip_rect().max.x - current_scroll_bar_width; // Nice handling of forced resizing beyond the possible
content_ui.set_clip_rect(content_clip_rect); content_ui.set_clip_rect(content_clip_rect);