Merge branch 'master' into issue/2403

# Conflicts:
#	modules/skybrowser/src/wwtcommunicator.cpp
This commit is contained in:
Ylva Selling
2023-01-04 11:19:54 -05:00
1316 changed files with 1460 additions and 1333 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
+1 -1
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
+1 -1
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
+23 -5
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
@@ -29,6 +29,7 @@
#include <modules/webbrowser/include/webkeyboardhandler.h>
#include <modules/webbrowser/webbrowsermodule.h>
#include <ghoul/misc/dictionaryjsonformatter.h>
#include <deque>
namespace {
constexpr std::string_view _loggerCat = "WwtCommunicator";
@@ -297,13 +298,30 @@ void WwtCommunicator::setImageOrder(const std::string& imageUrl, int order) {
// Find in selected images list
auto current = findSelectedImage(imageUrl);
auto target = _selectedImages.begin() + order;
int currentIndex = std::distance(_selectedImages.begin(), current);
// Make sure the image was found in the list
if (current != _selectedImages.end() && target != _selectedImages.end()) {
// Swap the two images
std::iter_swap(current, target);
std::deque<std::pair<std::string, double>> newDeque;
for (int i = 0; i < static_cast<int>(_selectedImages.size()); i++) {
if (i == currentIndex) {
continue;
}
else if (i == order) {
if (order < currentIndex) {
newDeque.push_back(*current);
newDeque.push_back(_selectedImages[i]);
}
else {
newDeque.push_back(_selectedImages[i]);
newDeque.push_back(*current);
}
}
else {
newDeque.push_back(_selectedImages[i]);
}
}
_selectedImages = newDeque;
int reverseOrder = static_cast<int>(_selectedImages.size()) - order - 1;
ghoul::Dictionary message = setLayerOrderMessage(imageUrl, reverseOrder);
sendMessageToWwt(message);
+1 -1
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2022 *
* Copyright (c) 2014-2023 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *