mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
fix 2d overlay deletion
This commit is contained in:
parent
b80d2a9b06
commit
ba8320f561
3 changed files with 16 additions and 2 deletions
|
@ -156,6 +156,19 @@ void Overlays::enable() {
|
|||
_enabled = true;
|
||||
}
|
||||
|
||||
Overlay::Pointer Overlays::take2DOverlay(const QUuid& id) {
|
||||
if (_shuttingDown) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QMutexLocker locker(&_mutex);
|
||||
auto overlayIter = _overlays.find(id);
|
||||
if (overlayIter != _overlays.end()) {
|
||||
return _overlays.take(id);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Overlay::Pointer Overlays::get2DOverlay(const QUuid& id) const {
|
||||
if (_shuttingDown) {
|
||||
return nullptr;
|
||||
|
@ -808,7 +821,7 @@ void Overlays::deleteOverlay(const QUuid& id) {
|
|||
return;
|
||||
}
|
||||
|
||||
Overlay::Pointer overlay = get2DOverlay(id);
|
||||
Overlay::Pointer overlay = take2DOverlay(id);
|
||||
if (overlay) {
|
||||
_overlaysToDelete.push_back(overlay);
|
||||
emit overlayDeleted(id);
|
||||
|
|
|
@ -94,6 +94,7 @@ public:
|
|||
void disable();
|
||||
void enable();
|
||||
|
||||
Overlay::Pointer take2DOverlay(const QUuid& id);
|
||||
Overlay::Pointer get2DOverlay(const QUuid& id) const;
|
||||
|
||||
/// adds an overlay that's already been created
|
||||
|
|
|
@ -926,7 +926,7 @@ SelectionDisplay = (function() {
|
|||
zRailOverlay
|
||||
];
|
||||
|
||||
const nonLayeredOverlays = [selectionBox, iconSelectionBox];
|
||||
var nonLayeredOverlays = [selectionBox, iconSelectionBox];
|
||||
|
||||
var maximumHandleInAllOverlays = handleDuplicator;
|
||||
|
||||
|
|
Loading…
Reference in a new issue