diff options
author | Hans Hagen <pragma@wxs.nl> | 2016-12-02 10:51:35 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-12-02 10:51:35 +0100 |
commit | e677a7fb12047017595fb29e212463dcb1cb2fa6 (patch) | |
tree | 7b9aa8df35083a9e7df4d20b1bba8e2d0ceb251b /tex/context/base/mkiv/grph-inc.lua | |
parent | b8a38bef2eaacea0dd17897dc99f1ef09b46a7e3 (diff) | |
download | context-e677a7fb12047017595fb29e212463dcb1cb2fa6.tar.gz |
2016-12-02 10:19:00
Diffstat (limited to 'tex/context/base/mkiv/grph-inc.lua')
-rw-r--r-- | tex/context/base/mkiv/grph-inc.lua | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tex/context/base/mkiv/grph-inc.lua b/tex/context/base/mkiv/grph-inc.lua index e9bf17bf0..d948d9ad8 100644 --- a/tex/context/base/mkiv/grph-inc.lua +++ b/tex/context/base/mkiv/grph-inc.lua @@ -1249,9 +1249,14 @@ function figures.done(data) local box = texgetbox(nr) ds.width = box.width ds.height = box.height - ds.xscale = ds.width /(du.width or 1) - ds.yscale = ds.height/(du.height or 1) - ds.page = ds.page or du.page or dr.page -- sort of redundant but can be limited + -- somehow this fails on some of tacos files + -- ds.xscale = ds.width /(du.width or 1) + -- ds.yscale = ds.height/(du.height or 1) + -- so we add some extra safeguards + ds.xscale = ds.width /(du.width and du.width>0 and du.width or du.xsize) or 1 + ds.yscale = ds.height/(du.height and du.height>0 and du.height or du.ysize) or 1 + -- sort of redundant but can be limited + ds.page = ds.page or du.page or dr.page return data end |