mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-02-18 10:59:18 -06:00
Fix some bugs with the border radius
This commit is contained in:
@@ -78,6 +78,7 @@ private:
|
||||
bool _isSyncedWithWwt = false;
|
||||
bool _textureDimensionsIsDirty = false;
|
||||
bool _ratioIsDirty = false;
|
||||
bool _radiusIsDirty = false;
|
||||
bool _isInitialized = false;
|
||||
|
||||
float _ratio = 1.f;
|
||||
|
||||
@@ -54,6 +54,10 @@ float createLine(float lineCenter, float lineWidth, float coord) {
|
||||
return step(startEdge, coord) - step(endEdge, coord);
|
||||
}
|
||||
|
||||
float createFilledRectangle(float width, float height, vec2 coord) {
|
||||
return createLine(0.5, width, coord.x) * createLine(0.5, height, coord.y);
|
||||
}
|
||||
|
||||
float createCrosshair(in float linewidth, in float ratio, in vec2 coord) {
|
||||
const float Center = 0.5;
|
||||
float crosshairVertical = createLine(Center, linewidth * VerticalThickness, coord.x);
|
||||
|
||||
@@ -431,7 +431,8 @@ namespace {
|
||||
glm::vec3 positionTarget = glm::vec3(0.9f, 0.4f, -2.1f);
|
||||
glm::dvec3 galacticTarget = skybrowser::localCameraToGalactic(positionTarget);
|
||||
std::string guiPath = "/Sky Browser";
|
||||
std::string url = "http://wwt.openspaceproject.com/1/openspace/";
|
||||
//std::string url = "http://wwt.openspaceproject.com/1/openspace/";
|
||||
std::string url = "http://localhost:8000/openspace";
|
||||
double fov = 70.0;
|
||||
double size = skybrowser::sizeFromFov(fov, galacticTarget);
|
||||
|
||||
|
||||
@@ -201,6 +201,7 @@ void ScreenSpaceSkyBrowser::updateTextureResolution() {
|
||||
_browserPixeldimensions = glm::ivec2(newSize);
|
||||
_texture->setDimensions(glm::ivec3(newSize, 1));
|
||||
_objectSize = glm::ivec3(_texture->dimensions());
|
||||
_radiusIsDirty = true;
|
||||
}
|
||||
|
||||
void ScreenSpaceSkyBrowser::addDisplayCopy(const glm::vec3& raePosition, int nCopies) {
|
||||
@@ -324,8 +325,12 @@ void ScreenSpaceSkyBrowser::update() {
|
||||
_isInitialized = false;
|
||||
}
|
||||
|
||||
WwtCommunicator::update();
|
||||
if (_radiusIsDirty) {
|
||||
setBorderRadius(_borderRadius);
|
||||
}
|
||||
|
||||
ScreenSpaceRenderable::update();
|
||||
WwtCommunicator::update();
|
||||
}
|
||||
|
||||
void ScreenSpaceSkyBrowser::setVerticalFovWithScroll(float scroll) {
|
||||
|
||||
Reference in New Issue
Block a user