Comparing version 17.0.2 to 17.1.0
@@ -14,2 +14,3 @@ import { | ||
isExpanded, | ||
isHorizontal, | ||
isEventSubProcess | ||
@@ -316,3 +317,3 @@ } from '../../util/DiUtil'; | ||
if (element.height >= 120) { | ||
if (isHorizontal(element) ? element.height >= 120 : element.width >= 120) { | ||
assign(actions, { | ||
@@ -330,3 +331,3 @@ 'lane-divide-two': { | ||
if (element.height >= 180) { | ||
if (isHorizontal(element) ? element.height >= 180 : element.width >= 180) { | ||
assign(actions, { | ||
@@ -333,0 +334,0 @@ 'lane-divide-three': { |
@@ -6,2 +6,6 @@ import { | ||
import { | ||
isHorizontal | ||
} from '../../../util/DiUtil'; | ||
/** | ||
@@ -49,12 +53,14 @@ * @typedef {import('diagram-js/lib/command/CommandHandler').default} CommandHandler | ||
var newLanesHeight = Math.round(shape.height / newLanesCount); | ||
var isHorizontalLane = isHorizontal(shape); | ||
// Iterate from top to bottom in child lane order, | ||
var laneBaseSize = isHorizontalLane ? shape.height : shape.width; | ||
var newLanesSize = Math.round(laneBaseSize / newLanesCount); | ||
// Iterate from first to last in child lane order, | ||
// resizing existing lanes and creating new ones | ||
// so that they split the parent proportionally. | ||
// | ||
// Due to rounding related errors, the bottom lane | ||
// Due to rounding related errors, the last lane | ||
// needs to take up all the remaining space. | ||
var laneY, | ||
laneHeight, | ||
var laneSize, | ||
laneBounds, | ||
@@ -66,16 +72,19 @@ newLaneAttrs, | ||
laneY = shape.y + idx * newLanesHeight; | ||
// if bottom lane | ||
// if last lane | ||
if (idx === newLanesCount - 1) { | ||
laneHeight = shape.height - (newLanesHeight * idx); | ||
laneSize = laneBaseSize - (newLanesSize * idx); | ||
} else { | ||
laneHeight = newLanesHeight; | ||
laneSize = newLanesSize; | ||
} | ||
laneBounds = { | ||
laneBounds = isHorizontalLane ? { | ||
x: shape.x + LANE_INDENTATION, | ||
y: laneY, | ||
y: shape.y + idx * newLanesSize, | ||
width: shape.width - LANE_INDENTATION, | ||
height: laneHeight | ||
height: laneSize | ||
} : { | ||
x: shape.x + idx * newLanesSize, | ||
y: shape.y + LANE_INDENTATION, | ||
width: laneSize, | ||
height: shape.height - LANE_INDENTATION | ||
}; | ||
@@ -91,3 +100,4 @@ | ||
newLaneAttrs = { | ||
type: 'bpmn:Lane' | ||
type: 'bpmn:Lane', | ||
isHorizontal: isHorizontalLane | ||
}; | ||
@@ -94,0 +104,0 @@ |
{ | ||
"name": "bpmn-js", | ||
"version": "17.0.2", | ||
"version": "17.1.0", | ||
"description": "A bpmn 2.0 toolkit and web modeler", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4894778
124556