shithub: pain

Download patch

ref: 9811bf0e2479014d7b2ca71dd59c8557ed70780f
parent: 66eabf3368847f5c6c5a266c4f07214ba3472572
author: jmq <jmq@jmq.sh>
date: Fri Aug 22 23:37:41 EDT 2025

pill: fixed resizing

--- a/pill/pill.c
+++ b/pill/pill.c
@@ -52,9 +52,6 @@
 	sr = rectsubpt(s->r, s->r.min);
 
 	tr = dr;
-	if (Dx(dr) < Dx(sr)) {
-		tr.max.x = tr.min.x + Dx(sr);
-	}
 	if (Dy(dr) < Dy(sr)) {
 		tr.max.y = tr.min.y + Dy(sr);
 	}
@@ -72,6 +69,7 @@
 	}
 
 	scale = ((float)Dx(sr))/((float)Dx(tr));
+
 	p = ZP;
 	r.min = tr.min;
 	r.max.y = tr.max.y;
@@ -96,7 +94,7 @@
 		return -1;
 	}
 
-	scale = ((float)Dy(tr))/((float)Dy(dr));
+	scale = ((float)Dy(sr))/((float)Dy(dr));
 
 	p = ZP;
 	r.min = d->r.min;
@@ -114,6 +112,7 @@
  		draw(d, r, c, nil, ZP);
  		i+=1;
  	}
+
 
 	freeimage(t);
 	freeimage(c);
--