Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 42431 - PaintListener for Table gets misalligned GC in paintControl().
Summary: PaintListener for Table gets misalligned GC in paintControl().
Status: RESOLVED DUPLICATE of bug 42416
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.1.1   Edit
Hardware: PC Linux-GTK
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-02 23:51 EDT by Dave Steinberg CLA
Modified: 2003-09-04 14:07 EDT (History)
0 users

See Also:


Attachments
Screen capture of a TableTree showing (0,0) on the GC. (4.09 KB, image/gif)
2003-09-02 23:56 EDT, Dave Steinberg CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Steinberg CLA 2003-09-02 23:51:45 EDT
I'm adding a PaintListener to the Table underlying a TableTree, and seeing a
problem in paintControl() on GTK.  There seems to be a misallignment between the
bounds of the PaintEvent's gc and the bounds of its widget (the Table).

For example, see the attached screen capture.  On it, I've just drawn two lines,
to show the top-left corner:

  event.gc.drawLine(0, 0, 0, 15);
  event.gc.drawLine(0, 0, 15, 0);

On other platforms, (0,0) is at the top of the header, but here, it's under
it.  Since I'm using the bounds of the items to figure out where to draw,
I've got a problem.  For example, if I getBounds() on the first item, it reports
x=1, y=31, which clearly doesn't line up with the GC like it does on other
platforms.

The Table available from event.widget has bounds just like on other platforms:
x=0, y=0.
Comment 1 Dave Steinberg CLA 2003-09-02 23:56:54 EDT
Created attachment 5951 [details]
Screen capture of a TableTree showing (0,0) on the GC.

In paintControl(), the origin appears under the Table's header.
Comment 2 Dave Steinberg CLA 2003-09-04 09:47:33 EDT
Investigating further, it seems that it's not just the GC that's misaligned, but
also the PaintEvent's x, y, width, and height values.

For example, my Table's height is 115, according to getBounds(), but when the
whole thing is repainting, the PaintEvent has y=0 and height=84.
Comment 3 Grant Gayed CLA 2003-09-04 14:07:11 EDT

*** This bug has been marked as a duplicate of 42416 ***