mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
use one multiply instead of two divide for minnodesize calc
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user