mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-12 14:29:42 -05:00
Cleanup
This commit is contained in:
@@ -275,7 +275,7 @@ SkyBrowserModule::SkyBrowserModule()
|
||||
_resizeDirection = _mouseOnPair->getBrowser()->isOnResizeArea(
|
||||
_mousePosition
|
||||
);
|
||||
if (_resizeDirection != glm::vec2{ 0 }) {
|
||||
if (_resizeDirection != glm::ivec2{ 0 }) {
|
||||
_mouseOnPair->getBrowser()->saveResizeStartSize();
|
||||
_startBrowserSize = _mouseOnPair->getBrowser()->
|
||||
screenSpaceDimensions();
|
||||
@@ -336,7 +336,7 @@ SkyBrowserModule::SkyBrowserModule()
|
||||
if (_isResizing) {
|
||||
// Calculate scaling factor
|
||||
glm::vec2 mouseDragVector = (_mousePosition-_startMousePosition);
|
||||
glm::vec2 scaling = mouseDragVector * _resizeDirection;
|
||||
glm::vec2 scaling = mouseDragVector * glm::vec2(_resizeDirection);
|
||||
glm::vec2 newSizeRelToOld = (_startBrowserSize + (scaling)) /
|
||||
_startBrowserSize;
|
||||
// Scale the browser
|
||||
@@ -345,7 +345,9 @@ SkyBrowserModule::SkyBrowserModule()
|
||||
// For dragging functionality, translate so it looks like the
|
||||
// browser isn't moving. Make sure the browser doesn't move in
|
||||
// directions it's not supposed to
|
||||
translation = mouseDragVector * abs(_resizeDirection) / 2.f;
|
||||
translation = 0.5f * mouseDragVector * abs(
|
||||
glm::vec2(_resizeDirection)
|
||||
);
|
||||
|
||||
}
|
||||
// Translate
|
||||
|
||||
@@ -137,7 +137,7 @@ private:
|
||||
glm::vec2 _startMousePosition;
|
||||
glm::vec2 _startDragPosition;
|
||||
glm::vec2 _startBrowserSize;
|
||||
glm::vec2 _resizeDirection{ 0.f };
|
||||
glm::ivec2 _resizeDirection{ 0 };
|
||||
|
||||
// Animation of rotation of camera to look at coordinate galactic coordinates
|
||||
glm::dvec3 _startAnimation;
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
#include <modules/skybrowser/include/screenspaceskybrowser.h>
|
||||
#include <modules/skybrowser/include/utility.h>
|
||||
#include <ghoul/misc/assert.h>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
@@ -34,8 +35,8 @@ namespace openspace {
|
||||
Pair::Pair(ScreenSpaceSkyBrowser* browser, ScreenSpaceSkyTarget* target)
|
||||
: _target(target), _browser(browser)
|
||||
{
|
||||
assert(browser != nullptr, "Sky browser is null pointer!");
|
||||
assert(target != nullptr, "Sky target is null pointer!");
|
||||
ghoul_assert(browser != nullptr, "Sky browser is null pointer!");
|
||||
ghoul_assert(target != nullptr, "Sky target is null pointer!");
|
||||
}
|
||||
|
||||
void Pair::lock() {
|
||||
|
||||
Reference in New Issue
Block a user