Skip to content

Commit 1687a28

Browse files
author
Chris Pettitt
committed
More fixes for lodash 4 API changes
Note this change comes from ciena-blueplanet@5a3e67e. Unfortunately, do to a move, git does not allow this to be cherry-picked.
1 parent d284539 commit 1687a28

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/position/bk.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,9 @@ function findSmallestWidthAlignment(g, xss) {
292292
* coordinate of the smallest width alignment.
293293
*/
294294
function alignCoordinates(xss, alignTo) {
295-
var alignToMin = _.min(alignTo),
296-
alignToMax = _.max(alignTo);
295+
var alignToVals = _.values(alignTo),
296+
alignToMin = _.min(alignToVals),
297+
alignToMax = _.max(alignToVals);
297298

298299
_.forEach(["u", "d"], function(vert) {
299300
_.forEach(["l", "r"], function(horiz) {
@@ -302,7 +303,8 @@ function alignCoordinates(xss, alignTo) {
302303
delta;
303304
if (xs === alignTo) return;
304305

305-
delta = horiz === "l" ? alignToMin - _.min(xs) : alignToMax - _.max(xs);
306+
var xsVals = _.values(xs);
307+
delta = horiz === "l" ? alignToMin - _.min(xsVals) : alignToMax - _.max(xsVals);
306308

307309
if (delta) {
308310
xss[alignment] = _.mapValues(xs, function(x) { return x + delta; });

0 commit comments

Comments
 (0)