CesiumGS/cesium

MOUSE_MOVE fires outside of canvas in Firefox

Open

#12,373 opened on 2024年12月13日

GitHub で見る
 (0 comments) (0 reactions) (0 assignees)JavaScript (11,758 stars) (3,324 forks)batch import
JTCgood first issueonrampingtype - bug

説明

What happened?

Inconsistent behavior of ScreenSpaceEventHandler with MOUSE_MOVE event between Firefox and Chrome.

In Chrome when the mouse moves out of the canvas and over another element the MOUSE_MOVE events stop. In Firefox the MOUSE_MOVE events continue and can have coordinates outside the range of the canvas.

My expectation is that the MOUSE_MOVE event is only triggered while the pointer is moving over the canvas element, and is not fired when the pointer is outside of the canvas.

https://github.com/user-attachments/assets/f4259184-29e5-4175-971b-58578d1c65da

Reproduction steps

  1. Open the below sandcastle in Chrome.
  2. Open the Console tab
  3. Move the mouse over the Cesium viewer and then over the red element
  4. Note that the console logs stop when the pointer moves over the red element
  5. Open sandcastle in Firefox
  6. Open the Console tab
  7. Move the mouse over the Cesium viewer and then over the red element
  8. Note that the console logs continue while over the red element, and the y value is negative.

Sandcastle example

https://sandcastle.cesium.com/#c=dVFta8IwEP4roftSQVLGvmktGyJsMHHg5qfCiMlNg+mlJJeKDP/7mlYnOBdIyHP3vFyItOiJNRr24NiEIezZFLwOFV91tbRMZIenFkloBFcmg3GJstNtBSpzLVxKB4DLWkiYNYD03JPSPoR7CQhcCmyEj04nD+6BXrAO9CRJW0y/AnYXlla2gar1GbDvElm3Yro1wI3d/LY5oHqzXkdR9I284/C/od4PNfD54mM5+5wvVrMoSIZJ7ulgoDjHPOqqto5YcCblPCOoaiMIfLYOcgfEpfd90llwZwN5reAyKWO1UErjZsQeHFTjS30t5G7jbEA1cqC6xrHv5tl5jFzphmk1KZOTcZkU8/a9rN2O0RYcxBN7HGGetZLTAy7qP19Y3OYZK+Ksi9bNiEOkbe+L177IOc+zFt5WkrVmLa6dfwA

Environment

Browser:

  • Chrome 131.0.6778.140
  • Firefox 133.0.3 CesiumJS Version: 1.124 Operating System: Windows 11 Enterprise 22631.4602

コントリビューターガイド