Skip to content

Commit 9dd166c

Browse files
committed
selectdirection PR review edits
1 parent 6d4a4f8 commit 9dd166c

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/components/fx/layout_defaults.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ module.exports = function supplyLayoutDefaults(layoutIn, layoutOut, fullData) {
1616
return Lib.coerce(layoutIn, layoutOut, layoutAttributes, attr, dflt);
1717
}
1818

19-
coerce('dragmode');
20-
coerce('selectdirection');
19+
var dragMode = coerce('dragmode');
20+
if(dragMode === 'select') coerce('selectdirection');
2121

2222
var hovermodeDflt;
2323
if(layoutOut._has('cartesian')) {

src/plots/cartesian/select.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,6 @@ function prepSelect(e, startX, startY, dragOptions, mode) {
192192
}
193193
}
194194

195-
var direction = fullLayout.selectdirection;
196-
197195
dragOptions.moveFn = function(dx0, dy0) {
198196
x1 = Math.max(0, Math.min(pw, dx0 + x0));
199197
y1 = Math.max(0, Math.min(ph, dy0 + y0));
@@ -202,6 +200,7 @@ function prepSelect(e, startX, startY, dragOptions, mode) {
202200
dy = Math.abs(y1 - y0);
203201

204202
if(mode === 'select') {
203+
var direction = fullLayout.selectdirection;
205204

206205
if(fullLayout.selectdirection === 'any') {
207206
if(dy < Math.min(dx * 0.6, MINSELECT)) direction = 'h';

test/jasmine/tests/shapes_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,7 @@ describe('A fixed size shape', function() {
10261026

10271027
var shapeAndResizeTypes = combinations(shapeTypes, resizeTypes);
10281028
shapeAndResizeTypes.forEach(function(testCase) {
1029-
describe('of type ' + testCase.type + ' can be ' + testCase.resizeDisplayName, function() {
1029+
describe('@flaky of type ' + testCase.type + ' can be ' + testCase.resizeDisplayName, function() {
10301030
resizeDirections.forEach(function(direction) {
10311031
it('over direction ' + direction, function(done) {
10321032
layout.shapes[0].type = testCase.type;

0 commit comments

Comments
 (0)