mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-76618 NPE at com.intellij.xml.breadcrumbs.BreadcrumbsComponent.getPreferredSize
This commit is contained in:
@@ -537,13 +537,13 @@ public class Splitter extends JPanel {
|
||||
float proportion;
|
||||
if (getOrientation()) {
|
||||
if (getHeight() > 0) {
|
||||
proportion = Math.min(1.0f, Math.max(getMinProportion(myFirstComponent), (float)myPoint.y / (float)Splitter.this.getHeight()));
|
||||
proportion = Math.min(1.0f, Math.max(.0f, Math.min(Math.max(getMinProportion(myFirstComponent), (float)myPoint.y / (float)Splitter.this.getHeight()), 1 - getMinProportion(mySecondComponent))));
|
||||
setProportion(proportion);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (getWidth() > 0) {
|
||||
proportion = Math.min(1.0f, Math.max(getMinProportion(myFirstComponent), (float)myPoint.x / (float)Splitter.this.getWidth()));
|
||||
proportion = Math.min(1.0f, Math.max(.0f, Math.min(Math.max(getMinProportion(myFirstComponent), (float)myPoint.x / (float)Splitter.this.getWidth()), 1 - getMinProportion(mySecondComponent))));
|
||||
setProportion(proportion);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -324,7 +324,7 @@ public class BreadcrumbsComponent<T extends BreadcrumbsItem> extends JComponent
|
||||
|
||||
public Dimension getPreferredSize() {
|
||||
final Graphics2D g2 = (Graphics2D)getGraphics();
|
||||
return new Dimension(Integer.MAX_VALUE, DEFAULT_PAINTER.getSize("DUMMY", g2.getFontMetrics(), Integer.MAX_VALUE).height + 1);
|
||||
return new Dimension(Integer.MAX_VALUE, g2 != null ? DEFAULT_PAINTER.getSize("DUMMY", g2.getFontMetrics(), Integer.MAX_VALUE).height + 1 : 1);
|
||||
}
|
||||
|
||||
public Dimension getMaximumSize() {
|
||||
|
||||
Reference in New Issue
Block a user