6735918: test/closed/javax/swing/JMenuItem/6458123/bug6458123.java fails on Linux
All the bearings-related code is removed from MenuItemLayoutHelper class Reviewed-by: alexp
This commit is contained in:
parent
aeb1b5f21c
commit
0e5cf24bb3
@ -572,9 +572,6 @@ public class MenuItemLayoutHelper {
|
||||
|
||||
alignRects(lr, alignment);
|
||||
|
||||
// Take into account the left side bearings for text and accelerator text.
|
||||
fixTextRects(lr);
|
||||
|
||||
// Set Y coordinate for text and icon.
|
||||
// Y coordinates for other rects
|
||||
// will be calculated later in layoutMenuItem.
|
||||
@ -607,10 +604,6 @@ public class MenuItemLayoutHelper {
|
||||
|
||||
alignRects(lr, alignment);
|
||||
|
||||
// Take into account the left side bearing for accelerator text.
|
||||
// The LSB for text is taken into account in layoutCompoundLabel() below.
|
||||
fixAccTextRect(lr);
|
||||
|
||||
// Center labelRect vertically
|
||||
calcLabelYPosition(lr);
|
||||
|
||||
@ -645,9 +638,6 @@ public class MenuItemLayoutHelper {
|
||||
|
||||
alignRects(lr, alignment);
|
||||
|
||||
// Take into account the left side bearings for text and accelerator text.
|
||||
fixTextRects(lr);
|
||||
|
||||
// Set Y coordinates for text and icon.
|
||||
// Y coordinates for other rects
|
||||
// will be calculated later in layoutMenuItem.
|
||||
@ -680,10 +670,6 @@ public class MenuItemLayoutHelper {
|
||||
|
||||
alignRects(lr, alignment);
|
||||
|
||||
// Take into account the left side bearing for accelerator text.
|
||||
// The LSB for text is taken into account in layoutCompoundLabel() below.
|
||||
fixAccTextRect(lr);
|
||||
|
||||
// Center labelRect vertically
|
||||
calcLabelYPosition(lr);
|
||||
|
||||
@ -741,29 +727,6 @@ public class MenuItemLayoutHelper {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes into account the left side bearings for text and accelerator text
|
||||
*/
|
||||
private void fixTextRects(LayoutResult lr) {
|
||||
if (htmlView == null) { // The text isn't a HTML
|
||||
int lsb = SwingUtilities2.getLeftSideBearing(mi, fm, text);
|
||||
if (lsb < 0) {
|
||||
lr.textRect.x -= lsb;
|
||||
}
|
||||
}
|
||||
fixAccTextRect(lr);
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes into account the left side bearing for accelerator text
|
||||
*/
|
||||
private void fixAccTextRect(LayoutResult lr) {
|
||||
int lsb = SwingUtilities2.getLeftSideBearing(mi, accFm, accText);
|
||||
if (lsb < 0) {
|
||||
lr.accRect.x -= lsb;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets Y coordinates of text and icon
|
||||
* taking into account the vertical alignment
|
||||
|
Loading…
x
Reference in New Issue
Block a user