mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 18:41:10 +02:00
Merge branch 'master' of github.com:highfidelity/hifi into bug16645
This commit is contained in:
commit
99b95acada
3 changed files with 21 additions and 10 deletions
|
@ -731,7 +731,7 @@ Item {
|
||||||
}
|
}
|
||||||
HiFiGlyphs {
|
HiFiGlyphs {
|
||||||
id: rezIcon;
|
id: rezIcon;
|
||||||
text: (root.buttonGlyph)[itemTypesArray.indexOf(root.itemType)];
|
text: root.isInstalled ? "" : (root.buttonGlyph)[itemTypesArray.indexOf(root.itemType)];
|
||||||
anchors.right: rezIconLabel.left;
|
anchors.right: rezIconLabel.left;
|
||||||
anchors.rightMargin: 2;
|
anchors.rightMargin: 2;
|
||||||
anchors.verticalCenter: parent.verticalCenter;
|
anchors.verticalCenter: parent.verticalCenter;
|
||||||
|
|
|
@ -1086,15 +1086,19 @@ function mouseReleaseEvent(event) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function wasTabletClicked(event) {
|
function wasTabletOrEditHandleClicked(event) {
|
||||||
var rayPick = Camera.computePickRay(event.x, event.y);
|
var rayPick = Camera.computePickRay(event.x, event.y);
|
||||||
var tabletIDs = getMainTabletIDs();
|
var result = Overlays.findRayIntersection(rayPick, true);
|
||||||
if (tabletIDs.length === 0) {
|
if (result.intersects) {
|
||||||
return false;
|
var overlayID = result.overlayID;
|
||||||
} else {
|
var tabletIDs = getMainTabletIDs();
|
||||||
var result = Overlays.findRayIntersection(rayPick, true, getMainTabletIDs());
|
if (tabletIDs.indexOf(overlayID) >= 0) {
|
||||||
return result.intersects;
|
return true;
|
||||||
|
} else if (selectionDisplay.isEditHandle(overlayID)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function mouseClickEvent(event) {
|
function mouseClickEvent(event) {
|
||||||
|
@ -1102,8 +1106,8 @@ function mouseClickEvent(event) {
|
||||||
var result, properties, tabletClicked;
|
var result, properties, tabletClicked;
|
||||||
if (isActive && event.isLeftButton) {
|
if (isActive && event.isLeftButton) {
|
||||||
result = findClickedEntity(event);
|
result = findClickedEntity(event);
|
||||||
tabletClicked = wasTabletClicked(event);
|
tabletOrEditHandleClicked = wasTabletOrEditHandleClicked(event);
|
||||||
if (tabletClicked) {
|
if (tabletOrEditHandleClicked) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -658,6 +658,7 @@ SelectionDisplay = (function() {
|
||||||
selectionBox,
|
selectionBox,
|
||||||
iconSelectionBox
|
iconSelectionBox
|
||||||
];
|
];
|
||||||
|
var maximumHandleInAllOverlays = handleCloner;
|
||||||
|
|
||||||
overlayNames[handleTranslateXCone] = "handleTranslateXCone";
|
overlayNames[handleTranslateXCone] = "handleTranslateXCone";
|
||||||
overlayNames[handleTranslateXCylinder] = "handleTranslateXCylinder";
|
overlayNames[handleTranslateXCylinder] = "handleTranslateXCylinder";
|
||||||
|
@ -781,6 +782,12 @@ SelectionDisplay = (function() {
|
||||||
return Math.abs(position.x) <= box.dimensions.x / 2 && Math.abs(position.y) <= box.dimensions.y / 2
|
return Math.abs(position.x) <= box.dimensions.x / 2 && Math.abs(position.y) <= box.dimensions.y / 2
|
||||||
&& Math.abs(position.z) <= box.dimensions.z / 2;
|
&& Math.abs(position.z) <= box.dimensions.z / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
that.isEditHandle = function(overlayID) {
|
||||||
|
var overlayIndex = allOverlays.indexOf(overlayID);
|
||||||
|
var maxHandleIndex = allOverlays.indexOf(maximumHandleInAllOverlays);
|
||||||
|
return overlayIndex >= 0 && overlayIndex <= maxHandleIndex;
|
||||||
|
};
|
||||||
|
|
||||||
// FUNCTION: MOUSE PRESS EVENT
|
// FUNCTION: MOUSE PRESS EVENT
|
||||||
that.mousePressEvent = function (event) {
|
that.mousePressEvent = function (event) {
|
||||||
|
|
Loading…
Reference in a new issue