PY-18440 Python consoles with scrollbar constantly twitching on repaint (quickfix with diff support)

This commit is contained in:
Sergey Malenkov
2016-03-17 18:09:34 +03:00
parent 9b817c4f14
commit e09404181f
@@ -272,7 +272,7 @@ public class JBViewport extends JViewport implements ZoomableViewport {
private static void updateBorder(Component view) {
if (view instanceof JTable) return; // tables are not supported yet
if (view instanceof JList || view instanceof JTree || view instanceof JComponent && Registry.is("ide.scroll.align.component")) {
if (view instanceof JComponent) {
JComponent component = (JComponent)view;
Border border = component.getBorder();
if (border instanceof ViewBorder) return; // already set
@@ -364,7 +364,7 @@ public class JBViewport extends JViewport implements ZoomableViewport {
if (va == Alignment.LEFT) {
insets.left += vsb.getWidth();
}
else if (va == Alignment.RIGHT && !SystemInfo.isMac) {
else if (va == Alignment.RIGHT && isAlignmentNeeded(view)) {
insets.right += vsb.getWidth();
}
}
@@ -375,7 +375,7 @@ public class JBViewport extends JViewport implements ZoomableViewport {
if (ha == Alignment.TOP) {
insets.top += hsb.getHeight();
}
else if (ha == Alignment.BOTTOM && !SystemInfo.isMac) {
else if (ha == Alignment.BOTTOM && isAlignmentNeeded(view)) {
insets.bottom += hsb.getHeight();
}
}
@@ -383,5 +383,9 @@ public class JBViewport extends JViewport implements ZoomableViewport {
}
}
}
private boolean isAlignmentNeeded(JComponent view) {
return !SystemInfo.isMac && (view instanceof JList || view instanceof JTree || Registry.is("ide.scroll.align.component"));
}
}
}