summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/node-nut.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/node-nut.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/node-nut.lua36
1 files changed, 36 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/base/node-nut.lua b/Master/texmf-dist/tex/context/base/node-nut.lua
index 32f2d57ec32..b133c4e7484 100644
--- a/Master/texmf-dist/tex/context/base/node-nut.lua
+++ b/Master/texmf-dist/tex/context/base/node-nut.lua
@@ -752,3 +752,39 @@ function nuts.copy_properties(source,target,what)
end
return newprops -- for checking
end
+
+-- a bit special
+
+local getwidth = { }
+local setwidth = { }
+local getdimensions = { }
+local setdimensions = { }
+
+nodes.whatsitters = {
+ getters = { width = getwidth, dimensions = getdimensions },
+ setters = { width = setwidth, dimensions = setdimensions },
+}
+
+-- this might move (in fact forms and images will become nodes)
+
+local function get_width(n,dir)
+ n = tonut(n)
+ return getfield(n,"width")
+end
+
+local function get_dimensions(n,dir)
+ n = tonut(n)
+ return getfield(n,"width"), getfield(n,"height"), getfield(n,"depth")
+end
+
+local whatcodes = nodes.whatcodes
+local pdfrefximage_code = whatcodes.pdfrefximage
+local pdfrefxform_code = whatcodes.pdfrefxform
+
+getwidth [pdfrefximage_code] = get_width
+getwidth [pdfrefxform_code ] = get_width
+
+getdimensions[pdfrefximage_code] = get_dimensions
+getdimensions[pdfrefxform_code ] = get_dimensions
+
+