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,
zRailOverlay
];
const nonLayeredOverlays = [selectionBox, iconSelectionBox];
var maximumHandleInAllOverlays = handleDuplicator;
overlayNames[handleTranslateXCone] = "handleTranslateXCone";
@ -1015,18 +1018,21 @@ SelectionDisplay = (function() {
// 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
var overlayIncludesLayered = overlayIncludes.filter(function (value, index, arr) {
return value != selectionBox && value != iconSelectionBox;
});
var overlayIncludesLayered = [];
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);
if (!intersectObj.intersects) {
var overlayIncludesNonLayered = overlayIncludes.filter(function (value, index, arr) {
return value == selectionBox || value == iconSelectionBox;
});
if (overlayIncludesNonLayered.length > 0) {
intersectObj = Overlays.findRayIntersection(queryRay, true, overlayIncludesNonLayered, overlayExcludes);
}
if (!intersectObj.intersects && overlayIncludesNonLayered.length > 0) {
intersectObj = Overlays.findRayIntersection(queryRay, true, overlayIncludesNonLayered, overlayExcludes);
}
if (wantDebug) {