summaryrefslogtreecommitdiff
path: root/graphics/asymptote/picture.cc
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/asymptote/picture.cc')
-rw-r--r--graphics/asymptote/picture.cc25
1 files changed, 19 insertions, 6 deletions
diff --git a/graphics/asymptote/picture.cc b/graphics/asymptote/picture.cc
index c0d7934f30..112ff18748 100644
--- a/graphics/asymptote/picture.cc
+++ b/graphics/asymptote/picture.cc
@@ -530,11 +530,8 @@ bool picture::texprocess(const string& texname, const string& outname,
cmd.push_back("-D600");
cmd.push_back("-O"+String(hoffset)+"bp,"+String(voffset)+"bp");
bool ps=pagecount() > 1;
- if(ps)
- cmd.push_back("-T"+String(getSetting<double>("paperwidth"))+"bp,"+
- String(paperHeight)+"bp");
- else
- cmd.push_back("-E");
+ cmd.push_back("-T"+String(getSetting<double>("paperwidth"))+"bp,"+
+ String(paperHeight)+"bp");
push_split(cmd,getSetting<string>("dvipsOptions"));
if(ps && getSetting<string>("papertype") != "")
cmd.push_back("-t"+papertype);
@@ -556,7 +553,20 @@ bool picture::texprocess(const string& texname, const string& outname,
const string endspecial="@fedspecial end";
const size_t endlength=endspecial.size();
+ bool inpapersize=false;
while(getline(fin,s)) {
+
+ if (inpapersize) {
+ if(s.find("%%EndPaperSize") == 0)
+ inpapersize=false;
+ continue;
+ } else {
+ if (s.find("%%BeginPaperSize:") == 0) {
+ inpapersize=true;
+ continue;
+ }
+ }
+
if (s[0] == '%') {
if (s.find("%%DocumentPaperSizes:") == 0)
continue;
@@ -1001,9 +1011,12 @@ bool picture::shipout(picture *preamble, const string& Prefix,
bool Labels=labels || TeXmode;
- if(png && (b.right-b.left < 1.0 || b.top-b.bottom < 1.0))
+ bool Empty=b.right-b.left < 1.0 || b.top-b.bottom < 1.0;
+ if(png && Empty)
empty=true;
+ if(Empty && (svgformat || htmlformat)) return true;
+
if(empty && !Labels) { // Output a null file
bbox b;
b.left=b.bottom=0;