shithub: slug

Download patch

ref: a149216460c3b1c809bab5eb461375e6a036012c
parent: 1122377ec3b6f86704e467a65ab22fdae2e45902
author: phil9 <telephil9@gmail.com>
date: Thu Dec 1 01:58:51 EST 2022

change point drawing based on strokeCap

--- a/api.c
+++ b/api.c
@@ -162,7 +162,10 @@
 	p1 = addpt(origin, Pt(x, y));
 	p2 = addpt(p1, Pt(strokewidth, strokewidth));
 	if(!nostroke)
-		draw(canvas, Rpt(p1, p2), stroke, nil, ZP);
+		if(strokecap == Endsquare)
+			draw(canvas, Rpt(p1, p2), stroke, nil, ZP);
+		else if(strokecap == Enddisc)
+			fillellipse(canvas, p1, strokewidth/2.0, strokewidth/2.0, stroke, ZP);
 	return 0;
 }