]> git.imager.perl.org - imager.git/blobdiff - fills.c
rearrange i_new_hatch_low() in fills.c
[imager.git] / fills.c
diff --git a/fills.c b/fills.c
index 4754e265925f7e3ea6caf18f4023654502e6c720..b2305802b545dee2522236267bd22bd103942429 100644 (file)
--- a/fills.c
+++ b/fills.c
@@ -647,25 +647,23 @@ i_new_hatch_low(const i_color *fg, const i_color *bg,
   i_fill_hatch_t *fill = mymalloc(sizeof(i_fill_hatch_t)); /* checked 14jul05 tonyc */
 
   *fill = hatch_fill_proto;
-  /* Some Sun C didn't like the condition expressions that were here.
-     See https://rt.cpan.org/Ticket/Display.html?id=21944
-   */
-  if (fg)
+  if (fg && bg) {
     fill->fg = *fg;
-  else
-    fill->fg = fcolor_to_color(ffg);
-  if (bg)
     fill->bg = *bg;
-  else
+    fill->ffg = color_to_fcolor(fg);
+    fill->fbg = color_to_fcolor(bg);
+  }
+  else if (ffg && fbg) {
+    fill->fg = fcolor_to_color(ffg);
     fill->bg = fcolor_to_color(fbg);
-  if (ffg) 
     fill->ffg = *ffg;
-  else
-    fill->ffg = color_to_fcolor(fg);
-  if (fbg)
     fill->fbg = *fbg;
-  else
-    fill->fbg = color_to_fcolor(bg);
+  }
+  else {
+    assert(0);
+    /* NOTREACHED */
+  }
+  
   if (combine) {
     i_get_combine(combine, &fill->base.combine, &fill->base.combinef);
   }