input: Fix invalid vertical scroll in single line mode. (#1273)
This commit is contained in:
parent
62e3f8126a
commit
c80704d4d8
1 changed files with 5 additions and 1 deletions
|
|
@ -1612,7 +1612,11 @@ impl InputState {
|
||||||
let safe_x_range =
|
let safe_x_range =
|
||||||
(-self.scroll_size.width + self.input_bounds.size.width).min(px(0.0))..px(0.);
|
(-self.scroll_size.width + self.input_bounds.size.width).min(px(0.0))..px(0.);
|
||||||
|
|
||||||
offset.y = offset.y.clamp(safe_y_range.start, safe_y_range.end);
|
offset.y = if self.mode.is_single_line() {
|
||||||
|
px(0.)
|
||||||
|
} else {
|
||||||
|
offset.y.clamp(safe_y_range.start, safe_y_range.end)
|
||||||
|
};
|
||||||
offset.x = offset.x.clamp(safe_x_range.start, safe_x_range.end);
|
offset.x = offset.x.clamp(safe_x_range.start, safe_x_range.end);
|
||||||
self.scroll_handle.set_offset(offset);
|
self.scroll_handle.set_offset(offset);
|
||||||
cx.notify();
|
cx.notify();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue