Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regarding the signature of outputYourself method #1987

Open
Omikhleia opened this issue Feb 4, 2024 · 0 comments
Open

Regarding the signature of outputYourself method #1987

Omikhleia opened this issue Feb 4, 2024 · 0 comments
Labels
question Ask for advice or investigate solutions refactor Code quality improvements

Comments

@Omikhleia
Copy link
Member

So here it is, from #1981 (comment)

The signature of the ouputYourself method is (self, typesetter, line)

I'd question, with the rationale of dis-entangling concepts, why the typesetter is still needed at output time.

Normally, the typesetter's job ought to be finished then, as we are pushing completed (= fully typeset) content to the page...

Unless mistaken, in all cases, what we only need... is the frame, to keep track of cursor positions.

I couldn't find other use cases in the code base than typesetter.frame.direction (e.g. in boustrophedon), typesetter.frame:advancePageDirection or typesetter.frame:advanceWritingDirection, typesetter.frame:newLine()
typesetter.frame:newLine(), typesetter.frame.state.cursorX and/or typesetter.frame.state.cursorY -- visibly, unless I missed something, it's always using the frame.

There's a reason why the typesetter was passed, as shown in #1981: at a much earlier stage, the frames were not here and the cursor tracking was done in the typesetter -- but that was in 2014...

So it would seem we now pass the typesetter to a method only needing the typesetter's frame, which does indeed sound logical...

Is this correct and should we proceed forward changing the signature and passing only the typesetter's frame?
(A compatibility shim should be straightforward, with a frame.frame field pointing to itself)

@Omikhleia Omikhleia added question Ask for advice or investigate solutions refactor Code quality improvements labels Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Ask for advice or investigate solutions refactor Code quality improvements
Projects
None yet
Development

No branches or pull requests

1 participant