david's comments

This commit is contained in:
SamGondelman 2019-01-30 11:50:32 -08:00
parent 57ee9786af
commit 7d47bfa2e4

View file

@ -899,6 +899,9 @@ SelectionDisplay = (function() {
yRailOverlay, yRailOverlay,
zRailOverlay zRailOverlay
]; ];
const nonLayeredOverlays = [selectionBox, iconSelectionBox];
var maximumHandleInAllOverlays = handleDuplicator; var maximumHandleInAllOverlays = handleDuplicator;
overlayNames[handleTranslateXCone] = "handleTranslateXCone"; overlayNames[handleTranslateXCone] = "handleTranslateXCone";
@ -1015,19 +1018,22 @@ SelectionDisplay = (function() {
// We want to first check the drawInFront overlays (i.e. the handles, but really everything except the selectionBoxes) // We want to first check the drawInFront overlays (i.e. the handles, but really everything except the selectionBoxes)
// so that you can click on them even when they're behind things // so that you can click on them even when they're behind things
var overlayIncludesLayered = overlayIncludes.filter(function (value, index, arr) { var overlayIncludesLayered = [];
return value != selectionBox && value != iconSelectionBox; var overlayIncludesNonLayered = [];
}); for (var i = 0; i < overlayIncludes.length; i++) {
var value = overlayIncludes[i];
if (nonLayeredOverlays.includes(value)) {
overlayIncludesNonLayered.push(value);
} else {
overlayIncludesLayered.push(value);
}
}
var intersectObj = Overlays.findRayIntersection(queryRay, true, overlayIncludesLayered, overlayExcludes); var intersectObj = Overlays.findRayIntersection(queryRay, true, overlayIncludesLayered, overlayExcludes);
if (!intersectObj.intersects) { if (!intersectObj.intersects && overlayIncludesNonLayered.length > 0) {
var overlayIncludesNonLayered = overlayIncludes.filter(function (value, index, arr) {
return value == selectionBox || value == iconSelectionBox;
});
if (overlayIncludesNonLayered.length > 0) {
intersectObj = Overlays.findRayIntersection(queryRay, true, overlayIncludesNonLayered, overlayExcludes); intersectObj = Overlays.findRayIntersection(queryRay, true, overlayIncludesNonLayered, overlayExcludes);
} }
}
if (wantDebug) { if (wantDebug) {
if (!overlayIncludes) { if (!overlayIncludes) {