Title: BasicAnnotationRenderer picking bug · Issue #196 · NASAWorldWind/WorldWindJava · GitHub
Open Graph Title: BasicAnnotationRenderer picking bug · Issue #196 · NASAWorldWind/WorldWindJava
X Title: BasicAnnotationRenderer picking bug · Issue #196 · NASAWorldWind/WorldWindJava
Description: public void pick(DrawContext dc, java.awt.Point pickPoint) { OGLStackHandler stackHandler = new OGLStackHandler(); BasicAnnotationRenderer.this.pickSupport.clearPickList(); BasicAnnotationRenderer.this.beginDrawAnnotations(dc, stackHandl...
Open Graph Description: public void pick(DrawContext dc, java.awt.Point pickPoint) { OGLStackHandler stackHandler = new OGLStackHandler(); BasicAnnotationRenderer.this.pickSupport.clearPickList(); BasicAnnotationRenderer....
X Description: public void pick(DrawContext dc, java.awt.Point pickPoint) { OGLStackHandler stackHandler = new OGLStackHandler(); BasicAnnotationRenderer.this.pickSupport.clearPickList(); BasicAnnotationRenderer....
Opengraph URL: https://github.com/NASAWorldWind/WorldWindJava/issues/196
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"BasicAnnotationRenderer picking bug","articleBody":"```java \r\n public void pick(DrawContext dc, java.awt.Point pickPoint)\r\n {\r\n OGLStackHandler stackHandler = new OGLStackHandler();\r\n BasicAnnotationRenderer.this.pickSupport.clearPickList();\r\n BasicAnnotationRenderer.this.beginDrawAnnotations(dc, stackHandler);\r\n try\r\n {\r\n this.annotation.setPickSupport(BasicAnnotationRenderer.this.pickSupport);\r\n this.doRender(dc, this);\r\n // Draw as many as we can in a batch to save ogl state switching.\r\n while (dc.peekOrderedRenderables() instanceof OrderedAnnotation)\r\n {\r\n OrderedAnnotation oa = (OrderedAnnotation) dc.pollOrderedRenderables();\r\n oa.annotation.setPickSupport(BasicAnnotationRenderer.this.pickSupport);\r\n this.doRender(dc, oa);\r\n }\r\n }\r\n catch (WWRuntimeException e)\r\n {\r\n Logging.logger().log(Level.SEVERE, \"generic.ExceptionWhilePickingAnnotation\", e);\r\n }\r\n catch (Exception e)\r\n {\r\n Logging.logger().log(Level.SEVERE, \"generic.ExceptionWhilePickingAnnotation\", e);\r\n }\r\n finally\r\n {\r\n BasicAnnotationRenderer.this.endDrawAnnotations(dc, stackHandler);\r\n BasicAnnotationRenderer.this.pickSupport.resolvePick(dc, pickPoint, this.layer);\r\n BasicAnnotationRenderer.this.pickSupport.clearPickList(); // to ensure entries can be garbage collected\r\n }\r\n }\r\n```\r\n\r\nThis method within BasicAnnotationRenderer handles picking for many different instances of OrderedAnnotation at the same time. There is no guarantee that the different instances of OrderedAnnotation will share the same parent layer.\r\n\r\nConsider two instances of OrderedAnnotation\r\n\r\n1) ScreenAnnotation, Parent=ViewControlsLayer\r\n2) GlobeAnnotation, Parent=SomeOtherLayer\r\n\r\nIf the pick method were first called on OrderedAnnotation 2, then the call to BasicAnnotationRenderer.this.pickSupport.resolvePick(dc, pickPoint, this.layer) will assign the parent of the picked object to \"SomeOtherLayer\" even if the topPickedObject was the ScreenAnnotation from the ViewControlsLayer. \r\n\r\nThis causes picking to fail for annotations, especially for ViewControlsLayer, because there is a check to validate that the parent of the top picked object (the ScreenAnnotation of the ViewControlsLayer) is the ViewControlsLayer, when in fact it is the parent layer of some other annotation.\r\n\r\nThis issue can be reproduced by aligning a button on the ViewControlsLayer with a GlobeAnnotation so that they render on top of each other. When this happens the ViewControlsLayer will not be properly hoverable or clickable even though it is the topPickedObject. \r\n\r\nExpected behavior: If the topPickedObject during picking was an instance of OrderedAnnotation, its parent layer must be set to its actual parent layer, not an unrelated layer also containing an OrderedAnnotation. \r\n\r\nReproduces: 100%\r\n\r\nOS / Version: Not Applicable","author":{"url":"https://github.com/feldhausenryan","@type":"Person","name":"feldhausenryan"},"datePublished":"2020-04-02T20:15:04Z","url":"https://github.com/NASAWorldWind/WorldWindJava/issues/196"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:aa143206-d286-015e-825d-eb0eb96bf487 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 855C:341AC2:1A55C5:241C85:6B0809E8 |
| html-safe-nonce | fd33467769646177c3b68e15f4e10275162c06a9d4652963006effaea1796202 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NTVDOjM0MUFDMjoxQTU1QzU6MjQxQzg1OjZCMDgwOUU4IiwidmlzaXRvcl9pZCI6IjEzODY3ODU0MzQ5MDIyMDI4NTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7f3a9f5d7d91b201691f99a75b2b94d7442769f63ab0309aa1e2ce2f60c68236 |
| hovercard-subject-tag | issue:592898100 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/NASAWorldWind/WorldWindJava/196/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8d107dd4c9007084481f403aea4d06f89291e9ec56a242d3194c909cadda85d6/NASAWorldWind/WorldWindJava/issues/196 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8d107dd4c9007084481f403aea4d06f89291e9ec56a242d3194c909cadda85d6/NASAWorldWind/WorldWindJava/issues/196 |
| og:image:alt | public void pick(DrawContext dc, java.awt.Point pickPoint) { OGLStackHandler stackHandler = new OGLStackHandler(); BasicAnnotationRenderer.this.pickSupport.clearPickList(); BasicAnnotationRenderer.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | feldhausenryan |
| hostname | github.com |
| expected-hostname | github.com |
| None | e7fc09dde6eb2239ee8ccebb1ae25db9baf98106fa8a9226504867ad8c6796eb |
| turbo-cache-control | no-preview |
| go-import | github.com/NASAWorldWind/WorldWindJava git https://github.com/NASAWorldWind/WorldWindJava.git |
| octolytics-dimension-user_id | 14023654 |
| octolytics-dimension-user_login | NASAWorldWind |
| octolytics-dimension-repository_id | 45006285 |
| octolytics-dimension-repository_nwo | NASAWorldWind/WorldWindJava |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 45006285 |
| octolytics-dimension-repository_network_root_nwo | NASAWorldWind/WorldWindJava |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7ed1dceffaf1a002c986fe8b058e5cc633009e43 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width