ref: a376bcda599c8533bce9ed6128a0d42eaea18ba4
parent: 12c7ae8759ec211ff3b3eed75d73fc673b1314bf
author: sirjofri <sirjofri@sirjofri.de>
date: Wed Aug 7 13:43:30 EDT 2024
fixes nil image if p9image has no mask, adds example
--- a/p9image.c
+++ b/p9image.c
@@ -153,6 +153,8 @@
ellipse(tstate.circle, Pt(20, 20), 20, 20, 0, display->black, ZP);
}
changecursor(&ccircle, tstate.circle, Pt(-20, -20));
+ if (!mi)
+ return;
r.min.x = r.min.y = 0;
r.max.x = Dx(i->r);
r.max.y = Dy(i->r);
binary files /dev/null b/test/img/layerA/img differ
binary files /dev/null b/test/img/layerA/mask differ
--- /dev/null
+++ b/test/img/layerA/meta
@@ -1,0 +1,3 @@
+p9img
+Layer A
+SoverD
binary files /dev/null b/test/img/layerB/img differ
binary files /dev/null b/test/img/layerB/mask differ
--- /dev/null
+++ b/test/img/layerB/meta
@@ -1,0 +1,3 @@
+p9img
+Layer B
+SoverD
--- /dev/null
+++ b/test/img/layers
@@ -1,0 +1,2 @@
+layerA
+layerB
--- /dev/null
+++ b/test/t.rc
@@ -1,0 +1,3 @@
+#!/bin/rc
+
+../6.out -cdd img > test.img