| Summary: | [rulers] Line numbers are not aligned with text | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Douglas Pollock <douglas.pollock> |
| Component: | UI | Assignee: | Tom Hofmann <eclipse> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | trivial | ||
| Priority: | P3 | CC: | daniel_megert |
| Version: | 3.0 | ||
| Target Milestone: | 3.0 RC1 | ||
| Hardware: | Sun | ||
| OS: | Solaris | ||
| Whiteboard: | |||
|
Description
Douglas Pollock
What font? Is this a regression? We cannot see it on Linux-GTK and WinXP. reproducible also on motif (I believe CDE is somehow motif-based, no?). On motif, we're off by 1 pixel with a courier 10pt, 3px with a 14 pt font. Default font (iso8859-1, courier(adobe), medium, 12). I'm not sure if this is a regression. CDE is the desktop environment. We only support Motif on Solaris. in 2.0, the line numbers are aligned, so this is a regression. Although, in 2.0, the line number ruler has double width... not sure what's worse. This also appears to affect the underlined items in the Java editor. The warning and error squigglies appear too high relative to the text. should check what changed since 2.0 This could be related to bug 63154. It mentions Solaris explicitely in bug 63154 comment 0, and the problem seems to be measuring line height / baseline. We debugged it down to GC.drawString: on Windows this seems to draw the string correctly but on Linux-Motif it's directly at the top. Felipe, is this another manifestation of the "baseline problem" that was introduced when we implemented italic fonts for StyledText? Daniel, try this: //code that draws the line number Font font = someFont; GC gc = someGC; gc.setFont(font); FontMetrics fm = gc.getFontMetrics(); int baseline = fm.getAscent() + fm.getLeading(); int stBaseline = styledText.getBaseline(); String lineNumber = "1"; gc.drawString(lineNumber, someX, someY + (stBaseline - baseline )); //end This should fix the problem. Daniel, send this pr back to me if the code in comment#10 doesn't work. tom, please try this out fixed > 20040524 start verifying... verified under Linux Motif on build I20040611. |