(evt, gd, dragOptions)
| 676 | } |
| 677 | |
| 678 | function coerceSelectionsCache(evt, gd, dragOptions) { |
| 679 | var fullLayout = gd._fullLayout; |
| 680 | var plotinfo = dragOptions.plotinfo; |
| 681 | var dragmode = dragOptions.dragmode; |
| 682 | |
| 683 | var selectingOnSameSubplot = ( |
| 684 | fullLayout._lastSelectedSubplot && |
| 685 | fullLayout._lastSelectedSubplot === plotinfo.id |
| 686 | ); |
| 687 | |
| 688 | var hasModifierKey = (evt.shiftKey || evt.altKey) && |
| 689 | !(drawMode(dragmode) && openMode(dragmode)); |
| 690 | |
| 691 | if( |
| 692 | selectingOnSameSubplot && |
| 693 | hasModifierKey && |
| 694 | plotinfo.selection && |
| 695 | plotinfo.selection.selectionDefs && |
| 696 | !dragOptions.selectionDefs |
| 697 | ) { |
| 698 | // take over selection definitions from prev mode, if any |
| 699 | dragOptions.selectionDefs = plotinfo.selection.selectionDefs; |
| 700 | dragOptions.mergedPolygons = plotinfo.selection.mergedPolygons; |
| 701 | } else if(!hasModifierKey || !plotinfo.selection) { |
| 702 | clearSelectionsCache(dragOptions); |
| 703 | } |
| 704 | |
| 705 | // clear selection outline when selecting a different subplot |
| 706 | if(!selectingOnSameSubplot) { |
| 707 | clearOutline(gd); |
| 708 | fullLayout._lastSelectedSubplot = plotinfo.id; |
| 709 | } |
| 710 | } |
| 711 | |
| 712 | function hasActiveShape(gd) { |
| 713 | return gd._fullLayout._activeShapeIndex >= 0; |
no test coverage detected
searching dependent graphs…