layout: skip notify when resize is clamped
This commit is contained in:
@@ -77,7 +77,8 @@ impl ResizableState {
|
||||
|
||||
let pane_count = mins.len();
|
||||
|
||||
let mut size = self.pane_size(ix, pane_count) + delta;
|
||||
let previous = self.pane_size(ix, pane_count);
|
||||
let mut size = previous + delta;
|
||||
size = size.max(floor);
|
||||
|
||||
if let Some(extent) = self.measured {
|
||||
@@ -90,15 +91,20 @@ impl ResizableState {
|
||||
size = size.min(ceiling);
|
||||
}
|
||||
|
||||
// Earlier panes hold the equal split they already render at, so the
|
||||
// first drag does not snap them to a backfilled default.
|
||||
// Earlier panes hold the equal split they already render at,
|
||||
// so the first drag does not snap them to a backfilled default.
|
||||
let backfill = self.equal_split(pane_count);
|
||||
while self.sizes.len() <= ix {
|
||||
self.sizes.push(backfill);
|
||||
}
|
||||
|
||||
self.sizes[ix] = size;
|
||||
cx.notify();
|
||||
|
||||
// A drag clamped at its floor or ceiling lands here on every mouse move,
|
||||
// only a change to the rendered size is worth a frame.
|
||||
if size != previous {
|
||||
cx.notify();
|
||||
}
|
||||
}
|
||||
|
||||
/// Restores pane `ix` to the equal split, as a double-click does.
|
||||
|
||||
Reference in New Issue
Block a user