| Summary: | ImageUtilities.createRotatedImageOfString doesn't take descent into account | ||
|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Alain Picard <picard> |
| Component: | GEF-Legacy Draw2d | Assignee: | Alexander Nyßen <nyssen> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | eclipse.felipe, nyssen |
| Version: | 3.7 | ||
| Target Milestone: | 3.7.2 (Indigo SR2) | ||
| Hardware: | PC | ||
| OS: | Windows Vista | ||
| Whiteboard: | |||
|
Description
Alain Picard
you forgot to add the leading try this: Image srcImage = new Image(display, strSize.width, metrics.getAscent() + metrics.getDescent() + metrics.getLeading()); reopen the bug if that doesn't work. Note that maybe you want to use TextLayout as you do more interesting things to text using a TextLayout. (and in TextLayout the value for leading is always zero (our secret), so if you forget it there you will be okay). As they say, one solution leads to another...better one. Great BTW this is a class supplied by Eclipse and used by many, not my code. So why won't this be fixed. That part doesn't make sense to me. (In reply to comment #3) > BTW this is a class supplied by Eclipse and used by many, not my code. So why > won't this be fixed. That part doesn't make sense to me. What class ? FontMetrics is fine IMO. See the doc for getAscent() and getDescent() they both are very explict saying that they don't include the leading. What do you want me to fix ? Sorry, I don't think I understood your suggestion. This is a bug report regarding class: org.eclipse.draw2d.ImageUtilities in method createRotatedImageOfString at line 53 where it now reads: Image srcImage = new Image(display, strSize.width, metrics.getAscent()); and it doesn't take into account the descent and also as got pointed out here, the leading value. So I would expect such a bug report (and solution) to be followed by a fix of this method in this dras2d class. Thanks! but that is not a SWT class, I believe it belongs to GEF. Changed implementation to now respect descent, ascent, and leading. Committed changes to cvs HEAD as well as R3_7_maintenance branch. Validated changes with GEF's rulers, which make use of this API. |