Skip to content

Commit 9eff6ac

Browse files
committed
increase resolution
1 parent eb2ef25 commit 9eff6ac

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ChaosSaver/ChaosRenderer.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ class ChaosRenderer {
3434
}
3535

3636
func drawPoint(_ x:Double, _ y:Double, _ color:PixelData) -> (Bool) {
37-
if x * 250 < Double(Int.max) && x * 250 > Double(Int.min) && y * 250 < Double(Int.max) && y * 250 > Double(Int.min) {
38-
let x = Int(x * 125) + width/2
39-
let y = Int(y * 125) + height/2
37+
if x * 500 < Double(Int.max) && x * 500 > Double(Int.min) && y * 500 < Double(Int.max) && y * 500 > Double(Int.min) {
38+
let x = Int(x * 500) + width/2
39+
let y = Int(y * 500) + height/2
4040

4141
if x > 0 && x < width && y > 0 && y < height {
4242
frameBuffer[y * width + x] = color
@@ -47,7 +47,7 @@ class ChaosRenderer {
4747
}
4848

4949
func render(_ cgContext:CGContext, _ rect:CGRect) {
50-
cgContext.setShouldAntialias(false)
50+
cgContext.setShouldAntialias(true)
5151

5252
//create CGImage from frame buffer
5353
let img = createImageFromPixels(pixels: frameBuffer, width: width, height: height)

ChaosSaver/ChaosSaverView.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ final class ChaosSaverView: ScreenSaverView {
2424

2525
//renderer = ChaosRenderer(Int(self.bounds.width), Int(self.bounds.height))
2626
//Maybe need to set frame buffer size depending on if it's a preview
27-
renderer = ChaosRenderer(1024, 576)
27+
renderer = ChaosRenderer(1920,1080)//(1024, 576)
2828
}
2929

3030
override func animateOneFrame() {

0 commit comments

Comments
 (0)