]> git.neil.brown.name Git - edlib.git/commitdiff
ncurses: fix transparent images in default color-space
authorNeilBrown <neil@brown.name>
Mon, 22 May 2023 09:09:14 +0000 (19:09 +1000)
committerNeilBrown <neil@brown.name>
Fri, 26 May 2023 22:18:42 +0000 (08:18 +1000)
When fg/bg are the defaults, pair_content() doesn't provide us with
useful information, so we have to assume "white"-ish.

Signed-off-by: NeilBrown <neil@brown.name>
DOC/TODO.md
display-ncurses.c

index 802538486948190a49b1ac914eceb3966136e97f..db8edd1d8ad254361bf47f52f20c900d0d7745e5 100644 (file)
@@ -27,7 +27,7 @@ Current priorities
 
 - [ ] big pop-up image viewer pane with zoom/pan
 - [ ] 'extra' headers to include:
-  Date: in my timezoneo
+  Date: in my timezone
 - [ ] in render-c-mode, in parse_code 'c' might be None - need to check
 
 - [ ] opening file with e.g. 200,000 lines is very slow
@@ -55,7 +55,7 @@ Current priorities
 Bugs to be fixed
 ----------------
 
-- [ ] transparent images appear in email with horiz lines
+- [X] transparent images appear in email with horiz lines
 - [ ] Replying to w3m/html mail results in unsightly markup in reply
 - [ ] redefining doc:char but not doc:content in mail-compose causes
       search to get confused.  What should we do?
index f7b85ec457de658adfa56bd1dcf9f24ab908568f..e0a39736fd51f000bdeb10222c5cba0d6c092213 100644 (file)
@@ -1079,7 +1079,15 @@ DEF_CMD(nc_draw_image)
                                }
                                if (pan) {
                                        wgetbkgrnd(panel_window(pan), &cc);
-                                       pair_content(cc.ext_color, &f, &b);
+                                       if (cc.ext_color == 0)
+                                               /* default.  This is light
+                                                * gray rather then white,
+                                                * but I think it is a good
+                                                * result.
+                                                */
+                                               b = COLOR_WHITE;
+                                       else
+                                               pair_content(cc.ext_color, &f, &b);
                                        if (p1[3] < 128)
                                                fg = b;
                                        if (p2[3] < 128)