| Summary: | Cocoa TableItem getImageBounds() always offsets x by 3 pixels | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Anirudh Sasikumar <anirudhsasikumar> |
| Component: | SWT | Assignee: | Scott Kovatch <skovatch> |
| Status: | RESOLVED INVALID | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | skovatch |
| Version: | 4.0 | ||
| Target Milestone: | --- | ||
| Hardware: | Macintosh | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
|
Description
Anirudh Sasikumar
(In reply to comment #0) > In TableItem getImageBounds(), there is a rect.x += Table.IMAGE_GAP at line > 512. It seems like that addition should be done only when image != null? No, this is correct. Run Snippet283 on Carbon and Cocoa -- the left edge of the images and the text are all in line. I will try to make a test case -- if you have one handy please attach it. I don't doubt this is a bug, but something I can compare against Carbon (for example) would be helpful. I see one possible culprit and one workaround. My guess right now is that the default width of the editor for the ComboBoxCellEditor is now too big, so it's pushing the combo off the edge of the cell. You can work around that by using a subclass of ComboBoxCellEditor that overrides getLayoutData() to return a smaller minimumWidth. Currently it returns a width that's 10 * average char width for the current font. The rects returned by getImageBounds, getBounds, and getBounds(int) are different than what Carbon returns, but they are all consistent. Hi Scott, Thank you, your workaround worked for me. I will work on making a small test case for this and posting it here. Thanks, Anirudh This might end up going to JFace, but for now this is not a bug on SWT's part. |