Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes label showing up in the upper left of the gsv view #3373

Merged
merged 4 commits into from
Sep 7, 2023

Conversation

tanayaxsharma
Copy link
Collaborator

Resolves #3336

Changed the x and y coordinate values of the label to be negative when it is outside of the viewing region. Also made sure that the labels were not being drawn when this is the case.

Before/After screenshots (if applicable)

Before:
image

After:
https://github.com/ProjectSidewalk/SidewalkWebpage/assets/92968308/0af03497-f047-4ead-b115-afb16bb17e42

@@ -268,8 +268,8 @@ function getCanvasCoordinate(origPov, newPov, canvasWidth, canvasHeight, iconWid
outputCoord.x = offset.left;
outputCoord.y = offset.top;
} else {
outputCoord.x = null;
outputCoord.y = null;
outputCoord.x = -iconWidth;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason that this needed to be changed from null to -iconWidth? Couldn't your code just check if the values are null instead of checking if they are less than 0? I'm just concerned about the possibility that we don't know what the implications are of changing the output of this function!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were there other instances where this function was outputting negative values that were problematic?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this also means that the label will disappear before it's fully off screen, correct? I think that the labels should continue to show until they would fully be off screen!

@tanayaxsharma
Copy link
Collaborator Author

I haven't seen other instances where this function was outputting problematic negative values. I agree that using null would be better to avoid any other issues though and I updated my code to use that instead of -iconWidth.

Copy link
Member

@misaugstad misaugstad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @tanayaxsharma !!

@misaugstad misaugstad merged commit b0b34e3 into develop Sep 7, 2023
@misaugstad misaugstad deleted the 3336-fixed-label-showing-in-upper-left-of-gsv branch September 7, 2023 19:14
@misaugstad misaugstad mentioned this pull request Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Label showing up in upper-left of GSV view
2 participants