Fix scroller position after reshape

This commit is contained in:
Nikita Lisitsa 2023-01-05 18:38:47 +03:00
parent 3f5735e10f
commit 2906e31634

View file

@ -224,6 +224,15 @@ namespace psemek::ui
child_bbox[0].max = child_bbox[0].min + child_constraints[0].min;
}
{
auto old_shift = shift_tgt_;
clamp_shift();
if (shift_tgt_[0] != old_shift[0])
shift_[0] = shift_tgt_[0];
if (shift_tgt_[1] != old_shift[1])
shift_[1] = shift_tgt_[1];
}
if (horizontal_scroll())
child_bbox[0] += shift_[0];