提交 9fb34d1f 编写于 作者: P peterz

6857888: closed/javax/swing/JMenuItem/6458123/bug6458123.java fails with InvocationTargetException.

Reviewed-by: alexp
上级 e8510841
...@@ -14824,7 +14824,9 @@ ...@@ -14824,7 +14824,9 @@
<background/> <background/>
<cacheSettingsInherited>false</cacheSettingsInherited> <cacheSettingsInherited>false</cacheSettingsInherited>
<cacheMode>NO_CACHING</cacheMode> <cacheMode>NO_CACHING</cacheMode>
<uiproperties/> <uiproperties>
<uiProperty name="textIconGap" type="INT" value="5"/>
</uiproperties>
</style> </style>
<backgroundStates> <backgroundStates>
<state stateKeys="Disabled"> <state stateKeys="Disabled">
...@@ -475,11 +475,11 @@ public class SynthGraphicsUtils { ...@@ -475,11 +475,11 @@ public class SynthGraphicsUtils {
return result; return result;
} }
static void applyInsets(Rectangle rect, Insets insets) { static void applyInsets(Rectangle rect, Insets insets, boolean leftToRight) {
if (insets != null) { if (insets != null) {
rect.x += insets.left; rect.x += (leftToRight ? insets.left : insets.right);
rect.y += insets.top; rect.y += insets.top;
rect.width -= (insets.right + rect.x); rect.width -= (leftToRight ? insets.right : insets.left) + rect.x;
rect.height -= (insets.bottom + rect.y); rect.height -= (insets.bottom + rect.y);
} }
} }
...@@ -492,12 +492,12 @@ public class SynthGraphicsUtils { ...@@ -492,12 +492,12 @@ public class SynthGraphicsUtils {
g.setFont(style.getFont(context)); g.setFont(style.getFont(context));
Rectangle viewRect = new Rectangle(0, 0, mi.getWidth(), mi.getHeight()); Rectangle viewRect = new Rectangle(0, 0, mi.getWidth(), mi.getHeight());
applyInsets(viewRect, mi.getInsets()); boolean leftToRight = SynthLookAndFeel.isLeftToRight(mi);
applyInsets(viewRect, mi.getInsets(), leftToRight);
SynthMenuItemLayoutHelper lh = new SynthMenuItemLayoutHelper( SynthMenuItemLayoutHelper lh = new SynthMenuItemLayoutHelper(
context, accContext, mi, checkIcon, context, accContext, mi, checkIcon, arrowIcon, viewRect,
arrowIcon, viewRect, defaultTextIconGap, acceleratorDelimiter, defaultTextIconGap, acceleratorDelimiter, leftToRight,
SynthLookAndFeel.isLeftToRight(mi),
MenuItemLayoutHelper.useCheckAndArrow(mi), propertyPrefix); MenuItemLayoutHelper.useCheckAndArrow(mi), propertyPrefix);
MenuItemLayoutHelper.LayoutResult lr = lh.layoutMenuItem(); MenuItemLayoutHelper.LayoutResult lr = lh.layoutMenuItem();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册