diff options
author | Hans Hagen <pragma@wxs.nl> | 2016-12-21 20:09:16 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-12-21 20:09:16 +0100 |
commit | 72e032447232f3f89056f352d3f6b8e2abc499cb (patch) | |
tree | dcce6719b22076c68a286ac202ea4245999c0843 /tex/context/base/mkiv/grph-inc.lua | |
parent | ae375264381ae74f70415b2351bdbf209248e1af (diff) | |
download | context-72e032447232f3f89056f352d3f6b8e2abc499cb.tar.gz |
2016-12-21 18:57:00
Diffstat (limited to 'tex/context/base/mkiv/grph-inc.lua')
-rw-r--r-- | tex/context/base/mkiv/grph-inc.lua | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tex/context/base/mkiv/grph-inc.lua b/tex/context/base/mkiv/grph-inc.lua index d948d9ad8..901d31827 100644 --- a/tex/context/base/mkiv/grph-inc.lua +++ b/tex/context/base/mkiv/grph-inc.lua @@ -1252,9 +1252,17 @@ function figures.done(data) -- 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 + -- du.width and du.height can be false + if du.width and du.height and du.width > 0 and du.height > 0 then + ds.xscale = ds.width /du.width + ds.yscale = ds.height/du.height + elseif du.xsize and du.ysize and du.xsize > 0 and du.ysize > 0 then + ds.xscale = ds.width /du.xsize + ds.yscale = ds.height/du.ysize + else + ds.xscale = 1 + ds.yscale = 1 + end -- sort of redundant but can be limited ds.page = ds.page or du.page or dr.page return data |