UNPKG
vmes-flowable
Version:
latest (1.0.0)
1.0.0
ceshibao
vmes-flowable
/
diagram-js
/
lib
/
util
/
PositionUtil.js
14 lines
(12 loc)
•
211 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
export
function
center
(
bounds
) {
return
{
x
: bounds.
x
+ (bounds.
width
/
2
),
y
: bounds.
y
+ (bounds.
height
/
2
) }; }
export
function
delta
(
a, b
) {
return
{
x
: a.
x
- b.
x
,
y
: a.
y
- b.
y
}; }