Mouse pointer moves to centre of canvas on click in OpenGL3 with Swing
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện vấn đề với JME 3.7.0-stable, một canvas OpenGL3 được nhúng trong Swing và một handler InputManager.addListener(ActionListener). So sánh InputManager.getCursorPosition() trong mouseDown và mouseUp, sau đó điều tra đường dẫn đầu vào của canvas Swing OpenGL3 so với hành vi của OpenGL2. Hoàn tất có nghĩa là con trỏ vẫn ở vị trí vật lý của nó và cả hai sự kiện đều báo cáo các tọa độ mong đợi mà không cần workaround Robot.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
With JME3.7 we can now embed OpenGL3 canvas in a Swing window. I have noticed an issue with the mouse with this configuration.
Steps to reproduce:
- Use JME 3.7.0-stable
- Be running OpenGL3
- Have a jme canvas embedded in a swing window
- Listen for jme mouse events using InputManager.addListener(ActionListener)
- Left click on the canvas
- In the ActionListener, get the position of the mouse using InputManager.getCursorPosition()
Observed
The mouseDown (i.e. keyPressed=true) will have the correct mouse position.
By the time the mouseUp event is processed (i.e. keyPressed=false), the position of the mouse has been moved to the centre of the canvas.
- The mouse is physically displayed in the centre of the canvas
- InputManager.getCursorPosition() will return a mouse position in the centre of the canvas
Notes:
- This does not happen if you are not using Swing
- This does not happen in OpenGL2 with Swing
- Seen on both Windows 10 and current Debian linux stable (12.7)
A workaround (more a hack) is to
- Store the location of the mousedown event
- In the mouseup event, use java.awt.Robot to move the mouse back to where the mousedown event happened.
- Ngôn ngữ chính
- Java
- Star
- 4.3k
- Fork
- 1.2k
- Merge trung bình
- 10 giờ 57 phút
- Pull request đã merge (30 ngày)
- 21
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của jMonkeyEngine/jmonkeyengine
-
Documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
jMonkeyEngine/jmonkeyengine#2928 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
jMonkeyEngine/jmonkeyengine#2919 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
defect
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
jMonkeyEngine/jmonkeyengine#2717 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Documentation
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
jMonkeyEngine/jmonkeyengine#2931 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Documentation
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 57/100
jMonkeyEngine/jmonkeyengine#2930 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của jMonkeyEngine/jmonkeyengine
Issue tương tự
-
[BUG] S3 CORS responses omit Access-Control-Allow-Credentials for matched originsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
floci-io/floci#5369 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
sqlcipher/sqlcipher-android#97 · 1 bình luận ·
-
area-integrations
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug IIIF interoperability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100