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

Object query sometimes returns extra nearby objects #28

Open
matthijskooijman opened this issue Jun 2, 2022 · 2 comments
Open

Object query sometimes returns extra nearby objects #28

matthijskooijman opened this issue Jun 2, 2022 · 2 comments

Comments

@matthijskooijman
Copy link

matthijskooijman commented Jun 2, 2022

While using ocharts with the oeuSENC-NL_BE charts, I noticed that sometimes double-clicking a buoy returned info on mutliple nearby buoys. Because objects are returned based on their bounding box (including any label), this is sometimes expected (though sometimes confusing, but I opened OpenCPN/OpenCPN#2712 about making sure the object clicked is actually shown at the top always).

For regular ENC charts, the behavior is what I expected based on (what I think are) the bounding boxes. However, for o-charts, I sometimes see objects returned that should not be based on (what I think is) their bounding box.

For example, with the Netherlands & Belgium chart (oeuSENC-NL_BE), around 53° 02.2163' N / 004° 51.3733' E at 1:10000 (1:9400 and 1:11000) also worked, clicking the OS2 buoy also returns info for the T12 buoy, whose bounding box I would expect to end to the left of the "T12" label, which is sufficiently far away from the click point to not be returned:

Screenshot from 2022-06-02 22-21-37

Interestingly, when I restart OpenCPN, the problem no longer occurs, but when I change the zoom and back (i.e. press - and then +), the problem does occur. Also, clicking quite a bit above (around the 291 deg label) or to the left of the T12 label also shows that buoy in the list. It seems a bit like the bounding box of the T12 label is bigger than it should be, while the bounding box of the icon is as expected.

This was tested using OpenCPN 5.6.1 and o-charts 1.0.25.0.

@matthijskooijman
Copy link
Author

It seems this is not 100% reproducible. I tested this with both OpenCPN and o-charts built from git, running in portable mode with a mostly clean config, and then could not reproduce the problem. Copying my regular opencpn.conf, the problem did occur, so I suspected something in my config to cause this, but then slowly changing the config back to the mostly clean config, I could not find any clear cause, and then with the mostly clean config, the problem occurred again.

To verify, I started again with a fully clean config, installed the o-charts plugin, downloaded the NL_BE charts and could reproduce the problem again.

@matthijskooijman
Copy link
Author

I wanted to further diagnose this by modifying the rendering code to draw the bounding boxes used for hittesting, but I'm not familiar enough with GL rendering, especially with various transformations involved, so after looking around the code a bit, I did not really try.

Hopefully others can reproduce this problem, and someone more familiar with the code can diagnose and fix it :-)

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

No branches or pull requests

1 participant