From c295b1c6ba67fd3df1e02f49d41b6a8a2461fcfb Mon Sep 17 00:00:00 2001 From: emile Date: Mon, 8 Oct 2018 16:46:06 +0200 Subject: Use the drawStars and saveImage function in Slice! --- draw/draw.go | 12 ++++++++---- 1 file 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) } -- cgit 1.4.1