mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-02-22 02:41:23 +01:00
use one multiply instead of two divide for minnodesize calc
This commit is contained in:
parent
c8d32c1668
commit
6df50a5790
@ -665,14 +665,12 @@ export class LayoutModel {
|
||||
|
||||
const clientPoint = parentIsRow ? x : y;
|
||||
const clientDiff = (this.resizeContext.resizeHandleStartPx - clientPoint) * this.resizeContext.pixelToSizeRatio;
|
||||
const minNodeSize = MinNodeSizePx * this.resizeContext.pixelToSizeRatio;
|
||||
const beforeNodeSize = this.resizeContext.beforeNodeStartSize - clientDiff;
|
||||
const afterNodeSize = this.resizeContext.afterNodeStartSize + clientDiff;
|
||||
|
||||
// If either node will be too small after this resize, don't let it happen.
|
||||
if (
|
||||
beforeNodeSize / this.resizeContext.pixelToSizeRatio < MinNodeSizePx ||
|
||||
afterNodeSize / this.resizeContext.pixelToSizeRatio < MinNodeSizePx
|
||||
) {
|
||||
if (beforeNodeSize < minNodeSize || afterNodeSize < minNodeSize) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user