-
Bug
-
Resolution: Unresolved
-
P3
-
8u40, 9, 10, 11
ADDITIONAL SYSTEM INFORMATION :
Tested under Windows 10 version 1803 with a user defined screen scaling of 125 %.
A DESCRIPTION OF THE PROBLEM :
Graphics.fillRect does not draw when height value is negative and screen scaling is >100 %.
The phenomenon is possibly related to Bug JDK-8203470.
REGRESSION : Last worked in version 8u161
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run the code below.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Both rectacles should be visible.
ACTUAL -
The first rectangle (above abscissa) is invisible.
---------- BEGIN SOURCE ----------
import java.awt.*;
import javax.swing.*;
public class InvisibleRectangle extends JFrame {
public static final long serialVersionUID = 1L;
public InvisibleRectangle() {
setSize(400, 300);
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
setVisible(true);
}
public static void main(String args[]) {
SwingUtilities.invokeLater(InvisibleRectangle::new);
}
public void paint(Graphics g) {
g.translate(0, 200);
g.setColor(Color.BLACK);
g.drawLine(50,0, 50, -150); // ordinate
g.drawLine(50,0, 300,0); // abscissa
g.setColor(Color.BLUE);
g.fillRect(100,0, 30,-80); // Above abscissa; does not paint.
g.fillRect(150,0, 30,50); // Below abscissa.
}
}
---------- END SOURCE ----------
FREQUENCY : always
Tested under Windows 10 version 1803 with a user defined screen scaling of 125 %.
A DESCRIPTION OF THE PROBLEM :
Graphics.fillRect does not draw when height value is negative and screen scaling is >100 %.
The phenomenon is possibly related to Bug JDK-8203470.
REGRESSION : Last worked in version 8u161
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and run the code below.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Both rectacles should be visible.
ACTUAL -
The first rectangle (above abscissa) is invisible.
---------- BEGIN SOURCE ----------
import java.awt.*;
import javax.swing.*;
public class InvisibleRectangle extends JFrame {
public static final long serialVersionUID = 1L;
public InvisibleRectangle() {
setSize(400, 300);
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
setVisible(true);
}
public static void main(String args[]) {
SwingUtilities.invokeLater(InvisibleRectangle::new);
}
public void paint(Graphics g) {
g.translate(0, 200);
g.setColor(Color.BLACK);
g.drawLine(50,0, 50, -150); // ordinate
g.drawLine(50,0, 300,0); // abscissa
g.setColor(Color.BLUE);
g.fillRect(100,0, 30,-80); // Above abscissa; does not paint.
g.fillRect(150,0, 30,50); // Below abscissa.
}
}
---------- END SOURCE ----------
FREQUENCY : always