| Summary: | MouseEvent coordinates over 32767 are lost | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Mircea Banu <mircea.banu> | ||||
| Component: | SWT | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> | ||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | ericwill | ||||
| Version: | 3.8.2 | Keywords: | triaged | ||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
This is due to a platform limitation on GTK, please see bug 472743. (In reply to Mircea Banu from comment #0) > Created attachment 261917 [details] > sample code > > If you add a MouseListener to a Canvas in SWT, x and y pointer events will > be limited to 32767. > Mouse events on a canvas bigger than that will have invalid mouse > coordinates. > > Same behavior on Linux and Windows. > > See the code below as example. Out of curiosity, what's your use case? A legacy API utilizing an SVG Canvas for drawing an interactive picture. In one of the cases I had really big picture (e.g. 60000 pixels wide). All mouse events over 32767 got negative x coordinates... At the time, I had no time to work around the API and implement a proper algorithm. (In reply to Mircea Banu from comment #3) > A legacy API utilizing an SVG Canvas for drawing an interactive picture. > In one of the cases I had really big picture (e.g. 60000 pixels wide). > All mouse events over 32767 got negative x coordinates... > > At the time, I had no time to work around the API and implement a proper > algorithm. Interesting. I guess for such large pictures one would probably have to do some partitioning or reduce resolution. An exotic and interesting bug report never the less. |
Created attachment 261917 [details] sample code If you add a MouseListener to a Canvas in SWT, x and y pointer events will be limited to 32767. Mouse events on a canvas bigger than that will have invalid mouse coordinates. Same behavior on Linux and Windows. See the code below as example.