Skip to content

Commit b1011b0

Browse files
committed
Bug 580248: Allow widget baseline to be less than font baseline
The removed assertion was overly harsh and some combinations of fonts and text meant that the assertion was being hit. This code was based on LineNumberRulerColumn (platform.text) which has long since removed the assertion - see eclipse-platform/eclipse.platform.text@3e70d44 for the removed assertion. Note that this change simply removes the assertion and does not address all the possibilities of mixed fonts. I suspect that there may be some (hopefully) small drawing errors if such mixed fonts are used. This code (unlike platform text) will continue to assume all lines are the same height. Change-Id: I3801b05c96e2784aabe53b3a503dbdb86e6e10c0
1 parent 98d3757 commit b1011b0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/provisional/DisassemblyRulerColumn.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -893,9 +893,8 @@ private int getBaselineBias(GC gc) {
893893
int widgetBaseline = fCachedTextWidget.getBaseline();
894894
FontMetrics fm = gc.getFontMetrics();
895895
int fontBaseline = fm.getAscent() + fm.getLeading();
896-
Assert.isTrue(widgetBaseline >= fontBaseline);
897896
int baselineBias = widgetBaseline - fontBaseline;
898-
return baselineBias;
897+
return Math.max(0, baselineBias);
899898
}
900899

901900
/**

0 commit comments

Comments
 (0)