mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-16 22:30:42 +02:00
hud module intersects with stats window
This commit is contained in:
parent
160be95081
commit
8f3fa08b1e
2 changed files with 13 additions and 8 deletions
|
@ -8,6 +8,7 @@ Item {
|
|||
|
||||
anchors.leftMargin: 300
|
||||
objectName: "StatsItem"
|
||||
property var statsObject: root
|
||||
|
||||
Component.onCompleted: {
|
||||
stats.parentChanged.connect(fill);
|
||||
|
|
|
@ -301,14 +301,18 @@ FocusScope {
|
|||
function isPointOnWindow(point) {
|
||||
for (var i = 0; i < desktop.visibleChildren.length; i++) {
|
||||
var child = desktop.visibleChildren[i];
|
||||
if (child.visible) {
|
||||
if (child.hasOwnProperty("modality")) {
|
||||
var mappedPoint = child.mapFromGlobal(point.x, point.y);
|
||||
var outLine = child.frame.children[2];
|
||||
var framePoint = outLine.mapFromGlobal(point.x, point.y);
|
||||
if (child.contains(mappedPoint) || outLine.contains(framePoint)) {
|
||||
return true;
|
||||
}
|
||||
var childName = child.objectName;
|
||||
if (child.hasOwnProperty("modality")) {
|
||||
var mappedPoint = child.mapFromGlobal(point.x, point.y);
|
||||
var outLine = child.frame.children[2];
|
||||
var framePoint = outLine.mapFromGlobal(point.x, point.y);
|
||||
if (child.contains(mappedPoint) || outLine.contains(framePoint)) {
|
||||
return true;
|
||||
}
|
||||
} else if (childName === "StatsItem") {
|
||||
var mappedPoint = child.statsObject.mapFromGlobal(point.x, point.y);
|
||||
if (child.statsObject.contains(mappedPoint)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue