View Issue Details

IDProjectCategoryView StatusLast Update
0001009contextbug reportpublic2019-07-20 18:49
ReporteritoijalaAssigned ToHans Hagen 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0001009: MP positionpage and positionpxy incorrect
DescriptionThe positionpage and positionpxy functions defined in mlib-lua.lua incorrectly print the page number to MP.
They use the format %p which results in scaled points. They should be using %i to output the page number as an integer.

See below for a test file showing the problem.
Steps To Reproduce\defineoverlay [backgraphics] [\positionoverlay{backgraphics}]

\startMPpositiongraphic{mpos:box}
  numeric func; func := positionpage(texstr("self"));
  message(func);

  numeric manual; manual := lua("mp.numeric(job.positions.collected['" & texstr("self") & "'].p)");
  message(manual);
\stopMPpositiongraphic

\setupbackgrounds[page][background={backgraphics,foreground}]

\starttext

\hpos{bar}{bar}
\startpositionoverlay{backgraphics}
  \setMPpositiongraphic{bar}{mpos:box}{self=bar}
\stoppositionoverlay

\stoptext
Additional InformationOutput:

metapost > message : 0.00002
metapost > message : 1

Expected output:

metapost > message : 1
metapost > message : 1
TagsNo tags attached.

Activities

Hans Hagen

2019-07-20 18:49

manager   ~0001714

Thanks for noticing. Fixed in next beta.

Issue History

Date Modified Username Field Change
2019-07-20 17:33 itoijala New Issue
2019-07-20 18:49 Hans Hagen Note Added: 0001714
2019-07-20 18:49 Hans Hagen Assigned To => Hans Hagen
2019-07-20 18:49 Hans Hagen Status new => closed
2019-07-20 18:49 Hans Hagen Resolution open => fixed