Fix some bugs with the border radius

This commit is contained in:
Ylva Selling
2022-08-12 15:01:32 -04:00
parent 0250098303
commit 74f6f0803a
4 changed files with 13 additions and 2 deletions

View File

@@ -78,6 +78,7 @@ private:
bool _isSyncedWithWwt = false;
bool _textureDimensionsIsDirty = false;
bool _ratioIsDirty = false;
bool _radiusIsDirty = false;
bool _isInitialized = false;
float _ratio = 1.f;

View File

@@ -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);

View File

@@ -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);

View File

@@ -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) {