summaryrefslogtreecommitdiff
path: root/tex/context/base/mkxl/anch-pos.lmt
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkxl/anch-pos.lmt')
-rw-r--r--tex/context/base/mkxl/anch-pos.lmt34
1 files changed, 19 insertions, 15 deletions
diff --git a/tex/context/base/mkxl/anch-pos.lmt b/tex/context/base/mkxl/anch-pos.lmt
index 67d1657f2..94eb443c6 100644
--- a/tex/context/base/mkxl/anch-pos.lmt
+++ b/tex/context/base/mkxl/anch-pos.lmt
@@ -477,25 +477,29 @@ implement {
local function b_region(specification)
local tag = specification.tag or specification
local last = tobesaved[tag]
- local x, y = getpos()
- last.x = x ~= 0 and x or nil
- last.y = y ~= 0 and y or nil
- last.p = texgetcount("realpageno")
- insert(regions,tag) -- todo: fast stack
- region = tag
+ if last then
+ local x, y = getpos()
+ last.x = x ~= 0 and x or nil
+ last.y = y ~= 0 and y or nil
+ last.p = texgetcount("realpageno")
+ insert(regions,tag) -- todo: fast stack
+ region = tag
+ end
end
local function e_region(specification)
local last = tobesaved[region]
- local y = getvpos()
- local x, y = getpos()
- if specification.correct then
- local h = (last.y or 0) - y
- last.h = h ~= 0 and h or nil
- end
- last.y = y ~= 0 and y or nil
- remove(regions) -- todo: fast stack
- region = regions[#regions]
+ if last then
+ local y = getvpos()
+ local x, y = getpos()
+ if specification.correct then
+ local h = (last.y or 0) - y
+ last.h = h ~= 0 and h or nil
+ end
+ last.y = y ~= 0 and y or nil
+ remove(regions) -- todo: fast stack
+ region = regions[#regions]
+ end
end
jobpositions.b_region = b_region