Skip to content

Commit d235f64

Browse files
committed
Fixed axis line bug with anti-aliasing, causing rough looking axes
1 parent 8374118 commit d235f64

File tree

8 files changed

+8
-2
lines changed

8 files changed

+8
-2
lines changed

GraphingCalculator/src/jonah/App.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ public static void main(String[] args) {
8484
System.out.println("███████╗██║███████╗╚█████╔╝██║ ██║███████╗╚█████╔╝ ");
8585
System.out.println("╚══════╝╚═╝╚══════╝ ╚════╝ ╚═╝ ╚═╝╚══════╝ ╚════╝ ");
8686
System.out.println("____________________________________________________");
87-
8887
functionCollection = new ArrayList<String>();
8988
boolean startGraph = false;
9089

@@ -687,7 +686,7 @@ public static void graph(int functionIndex) {
687686
xPairs.get(functionIndex).add(new Integer[2]);
688687
yPairs.get(functionIndex).get(pointer + 1)[0] = yPoint;
689688
xPairs.get(functionIndex).get(pointer + 1)[0] = x;
690-
} else if((tempArr[0] < 0 && yPoint < 0) | (tempArr[0] > 600 && yPoint > 600)) {
689+
} else if((tempArr[0] < 0 && yPoint < 0) | (tempArr[0] > 600 && yPoint > 600) | Math.abs(tempArr[0] - yPoint) > 610) {
691690
yPairs.get(functionIndex).get(pointer)[0] = yPoint;
692691
xPairs.get(functionIndex).get(pointer)[0] = x;
693692
}

GraphingCalculator/src/jonah/PixelGrid.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ public void setPixel(int x, int y, Color color, boolean showPixel) {
5555
for(int i = 0; i < functionAmount - 1; i++) {
5656
if(pixelVisible.get(i)[x][y]) {
5757
isVisible = true;
58+
if(color.equals(Color.black)) {
59+
Color newColor = pixelColors.get(i)[x][y];
60+
int r = newColor.getRed();
61+
int g = newColor.getGreen();
62+
int b = newColor.getBlue();
63+
setPoint(x, y, new Color(r, g, b), true, i);
64+
}
5865
}
5966
}
6067
if(!isVisible) {
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
68 Bytes
Binary file not shown.
222 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)