about summary refs log tree commit diff
diff options
context:
space:
mode:
authoremile <hanemile@protonmail.com>2018-10-08 16:46:06 +0200
committeremile <hanemile@protonmail.com>2018-10-08 16:46:06 +0200
commitc295b1c6ba67fd3df1e02f49d41b6a8a2461fcfb (patch)
tree0ad2ff7695d1fa1f33b7fba47d0117b49306f872
parentf3af8e9abd0fe9b6f678a11e5c4d30770d91841a (diff)
Use the drawStars and saveImage function in Slice!
-rw-r--r--draw/draw.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/draw/draw.go b/draw/draw.go
index 9af3ad9..68c4fa8 100644
--- a/draw/draw.go
+++ b/draw/draw.go
@@ -88,9 +88,13 @@ func drawStars(dc *gg.Context, slice []structs.Star) {
 
 // Slice draws the stars and the forces acting on them and saves the result to the given path
 func Slice(slice []structs.Star, path string) {
+
+	// initialize the plot
 	dc := initializePlot()
-	dc.SetRGB(1, 1, 1)
-	dc.DrawCircle(0, 0, 100)
-	dc.Stroke()
-	dc.SavePNG(path)
+
+	// draw all the stars in the given slice
+	drawStars(dc, slice)
+
+	// save the plot to the given path
+	saveImage(dc, path)
 }