-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Action Flow gradual left alignment (#2909)
* gradual left alignment of StepFlow * put shared branch sizes to ElementSizes * more accurate branching layout width calculation * fix UT Co-authored-by: Chris Whitten <christopher.whitten@microsoft.com>
- Loading branch information
Showing
7 changed files
with
65 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 1 addition & 4 deletions
5
Composer/packages/extensions/visual-designer/src/layouters/ifelseLayouter.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
Composer/packages/extensions/visual-designer/src/layouters/sharedLayouterUtils.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
import { BranchIntervalX, BranchAxisXIntervalMin } from '../constants/ElementSizes'; | ||
import { Boundary } from '../models/Boundary'; | ||
|
||
/** | ||
* Inputs two adjacent branch nodes, output their minimum interval x which satisfies two requirements: | ||
* 1. distance from leftNode's right broder to rightNode's left border >= ${BranchIntervalX} | ||
* 2. distance from leftNode's axis X to rightNode's axis X >= ${BranchAxisXIntervalMin} | ||
*/ | ||
export const calculateBranchNodesIntervalX = (leftNodeBound: Boundary, rightNodeBound?: Boundary) => { | ||
if (!rightNodeBound) return 0; | ||
|
||
return Math.max( | ||
BranchIntervalX, | ||
BranchAxisXIntervalMin - getRightWidth(leftNodeBound) - getLeftWidth(rightNodeBound) | ||
); | ||
}; | ||
|
||
export const getLeftWidth = (bound?: Boundary): number => (bound ? bound.axisX : 0); | ||
|
||
export const getRightWidth = (bound?: Boundary): number => (bound ? bound.width - bound.axisX : 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters