added background to svg if transparent not set

This commit is contained in:
Zeno Rogue 2018-12-13 17:57:26 +01:00
parent f34fae5bd8
commit 4370a18763
2 changed files with 3 additions and 0 deletions

View File

@ -1866,6 +1866,7 @@ namespace shot {
extern bool make_svg;
extern ld gamma, fade;
extern string caption;
extern bool transparent;
void menu();
void default_screenshot_content();
void take(string fname, const function<void()>& what = default_screenshot_content);

View File

@ -166,6 +166,8 @@ namespace svg {
#endif
println(f, "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"", coord(vid.xres), "\" height=\"", coord(vid.yres), "\">");
if(!shot::transparent)
println(f, "<rect width=\"", coord(vid.xres), "\" height=\"", coord(vid.yres), "\" ", stylestr((backcolor << 8) | 0xFF, 0, 0));
what();
println(f, "</svg>");