ToolTip overflow Fix and positioning#1054
Conversation
Question 1What's so bad about tooltip that follows mouse? It seems pretty responsive to me. Screencast.2021-11-17.13.49.09.mp4Question 2Seems like this still isn't optimal. You can end up completely covering a bounding box with a tooltip with no way around it. Screencast.2021-11-17.13.13.42.mp4Question 3Also seems like there's a race condition somewhere. The tooltip doesn't update sometimes when you move around. Screencast.2021-11-17.13.12.16.mp4 |
If your happy with the responsiveness we can go with that. The only counterpoint is that we have had some complaints about the tooltip drawing icons and people not liking them following the mouse closely. Maybe instead of a hover based tool it requires a different action to trigger?
I'm having trouble consistently replicating this but I did manage to get it to happen. It seems to happen a bit more when zoomed in vs the entire image. Thank you for the feedback and questions. I'm leaning more towards just having it attached to the mouse now. |
|
With option 1 (follow pointer) I did notice that depending on zoom level, the tooltip can be under the pointer and intercept mouse interactions. IDK if there's a reliable way around that. Because the coordinates are in image-space and not screen-space, having a constant offset is probably undesirable. |
As I recall, that was related to doing annotation. Someone thought the icons were in the way while drawing, which is fair. This you can turn off and isn't really useful while drawing anyway, so it's probably fine, but we should get someone like Matt or Roddy to actually decide. |
I also like Option 1. As for the image space / screen space issue, my gut tells me to ask David Manthey about it. GeoJS has ways to plot things in screen space, if I am not mistaken. |
|
I updated it for positioning the tooltip in a standard position based on zoomLevel and mouse following. There is a bit of a lag in the positioning though mousehover.mp4I'm open to any alternatives? |
|
This is perfect. I couldn't figure out from the code how you got the padding in screen space though, just curious |
I just pushed the changes, I need to self review it. I'm still using the The zooming event only supplies info in screenspace (relative to the element) so I would have to do some more conversions to get it right and that coordinate doesn't change after each zoom. It was much easier to just save the last mousePosition and use it like a mouseMove function for the zooming instead. |
subdavis
left a comment
There was a problem hiding this comment.
Perfect. I tested pretty extensively including annotation and continuous mode, editing, deleteing, etc, all looking great.
| } | ||
| }); | ||
| hoverOvered.value = hoveredVals.sort((a, b) => a.maxX - b.maxX); | ||
| uiLayer.setToolTipWidget('customToolTip', (found.length > 0)); |
There was a problem hiding this comment.
Should this technically be hoveredValues.length > 0 since there's a possibility to filter everything?
fixes #1051