shithub: pdffs

Download patch

ref: 523458eae9b4458dcd11e4019b15b5b95ae81bc1
parent: 259f6c1d22853bdbc4aed9748ca09465eaec35ff
author: Noam Preil <noam@pixelhero.dev>
date: Fri Apr 8 17:23:24 EDT 2022

op: properly initialize ctm

--- a/op.c
+++ b/op.c
@@ -727,7 +727,7 @@
  		return 0;
 	}
 	if(p->buf.b != nil)
-		memimagestring(p->image, Pt(Trm[4], 1100 - Trm[5]), memblack, Pt(0,0), getmemdefont(), (char*)p->buf.b + oend);
+		memimagestring(p->image, Pt(Trm[4], Trm[5]), memblack, Pt(0,0), getmemdefont(), (char*)p->buf.b + oend);
 	tx = glyphspacing(p, c);
 	mattrans(p->TS.Tm, tx, 0, p->TS.Tm);
 	p->TS.x = Trm[4] + tx;
@@ -1309,7 +1309,8 @@
 	mx = arrayget(cropbox, 2)->num.d;
 	my = arrayget(cropbox, 3)->num.d;
 	ctm[0] = 850 / mx;
-	ctm[3] = 1100 / my;
+	ctm[3] = -1100 / my;
+	ctm[5] = 1100;
 }
 
 void