diff options
Diffstat (limited to 'tex/context/base/scrn-pag.mkvi')
-rw-r--r-- | tex/context/base/scrn-pag.mkvi | 125 |
1 files changed, 75 insertions, 50 deletions
diff --git a/tex/context/base/scrn-pag.mkvi b/tex/context/base/scrn-pag.mkvi index aa1bd6999..c982eb402 100644 --- a/tex/context/base/scrn-pag.mkvi +++ b/tex/context/base/scrn-pag.mkvi @@ -22,65 +22,52 @@ \installparameterhandler \??sc {interactionscreen} \installsetuphandler \??sc {interactionscreen} -\def\scrn_canvas_synchronize_simple % this will be done differently (or disappear) - {\begingroup - \ifx\@@ppleft \empty - \ifx\@@ppright \empty - \ifx\@@pptop \empty - \ifx\@@ppbottom \empty - \ifx\@@pcstate\v!start - \locationfalse\fi\else - \locationfalse\fi\else - \locationfalse\fi\else - \locationfalse\fi\else - \locationfalse\fi - \iflocation % without screen settings - \ctxcommand{setupcanvas{ - paperwidth = \number\paperwidth, - paperheight = \number\paperheight - }}% - \else - \ctxcommand{setupcanvas{ - paperwidth = \number\printpaperwidth, - paperheight = \number\printpaperheight - }}% - \fi - \endgroup} +\newdimen\canvaswidth +\newdimen\canvasheight +\newdimen\canvasbackoffset +\newdimen\canvastopoffset -\def\scrn_canvas_synchronize_complex +\def\scrn_canvas_calculate {\begingroup \edef\currentinteractionscreenwidth {\interactionscreenparameter\c!width }% \edef\currentinteractionscreenheight{\interactionscreenparameter\c!height}% + \canvasbackoffset\backspace + \canvastopoffset\topoffset \ifx\currentinteractionscreenwidth\v!fit - \!!widtha\leftcombitotal - \ifdim\backspace>\!!widtha + \global\canvaswidth\leftcombitotal + \ifdim\backspace>\canvaswidth \ifdim\backspace>\zeropoint\relax - \advance\backspace -\!!widtha + \global\advance\canvasbackspace -\canvaswidth \fi \fi - \advance\!!widtha\dimexpr + \global\advance\canvaswidth\dimexpr \rightcombitotal + 2\dimexpr \interactionscreenparameter\c!backspace + \interactionscreenparameter\c!horoffset \relax \relax + \donetrue \else\ifx\currentinteractionscreenwidth\v!max - \!!widtha\printpaperwidth + \global\canvaswidth\printpaperwidth + \donetrue \else - \!!widtha\currentinteractionscreenwidth - \fi\fi - \ifdim\!!widtha>\paperwidth\ifdim\!!widtha>\zeropoint - \global\paperwidth\!!widtha + \global\canvaswidth\currentinteractionscreenwidth + \donefalse \fi\fi + \ifdone + \ifdim\canvaswidth>\paperwidth\ifdim\canvaswidth>\zeropoint + \global\paperwidth\canvaswidth % kills location=middle + \fi\fi + \fi \ifx\currentinteractionscreenheight\v!fit - \!!heighta\dimexpr\topheight+\topdistance\relax - \ifdim\topspace>\!!heighta + \global\canvasheight\dimexpr\topheight+\topdistance\relax + \ifdim\topspace>\canvasheight \ifdim\topspace>\zeropoint\relax - \advance\topspace -\!!heighta + \global\advance\canvastopspace -\canvasheight \fi \fi - \advance\!!heighta\dimexpr + \global\advance\canvasheight\dimexpr \makeupheight + \bottomdistance + \bottomheight @@ -89,26 +76,64 @@ + \interactionscreenparameter\c!veroffset \relax \relax + \donetrue \else\ifx\currentinteractionscreenheight\v!max - \!!heighta\printpaperheight + \global\canvasheight\printpaperheight + \donetrue \else - \!!heighta\currentinteractionscreenheight - \fi\fi - \ifdim\!!heighta>\paperheight\ifdim\!!heighta>\zeropoint - \global\paperheight\!!heighta + \global\canvasheight\currentinteractionscreenheight + \donefalse \fi\fi - \ctxcommand{setupcanvas{ + \ifdone + \ifdim\canvasheight>\paperheight\ifdim\canvasheight>\zeropoint + \global\paperheight\canvasheight % kills location=middle + \fi\fi + \fi + \endgroup} + +\appendtoks + \ifproductionrun + \scrn_canvas_calculate + \fi +\to \everysetupinteractionscreen + +\def\scrn_canvas_synchronize_simple % this will be done differently (or disappear) + {\begingroup + \ifx\@@ppleft \empty + \ifx\@@ppright \empty + \ifx\@@pptop \empty + \ifx\@@ppbottom \empty + \ifx\@@pcstate\v!start + \locationfalse\fi\else + \locationfalse\fi\else + \locationfalse\fi\else + \locationfalse\fi\else + \locationfalse\fi + \iflocation % without screen settings + \ctxcommand{setupcanvas{ + paperwidth = \number\paperwidth, + paperheight = \number\paperheight + }}% + \else + \ctxcommand{setupcanvas{ + paperwidth = \number\printpaperwidth, + paperheight = \number\printpaperheight + }}% + \fi + \endgroup} + +\def\scrn_canvas_synchronize_complex + {\ctxcommand{setupcanvas{ mode = "\interactionscreenparameter\c!option", singlesided = \ifsinglesided true\else false\fi, doublesided = \ifdoublesided true\else false\fi, - leftoffset = \number\dimexpr\backoffset\relax, - topoffset = \number\dimexpr\topoffset \relax, - width = \number\dimexpr\!!widtha \relax, - height = \number\dimexpr\!!heighta \relax, + leftoffset = \number\dimexpr\canvasbackoffset\relax, + topoffset = \number\dimexpr\canvastopoffset\relax, + width = \number\dimexpr\canvaswidth\relax, + height = \number\dimexpr\canvasheight\relax, paperwidth = \number\paperwidth, paperheight = \number\paperheight - }}% - \endgroup} + }}} \let\scrn_canvas_synchronize\scrn_canvas_synchronize_simple |