<div dir="ltr"><div dir="ltr">Hi Patrick,<br></div><div dir="ltr"><br></div><div>i did not have time to inquire about the .cs but I can partially answer<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mar. 28 mai 2019 à 18:27, <<a href="mailto:patrick.rein@hpi.uni-potsdam.de">patrick.rein@hpi.uni-potsdam.de</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi everyone,<br>
<br>
please find attached a change set which includes:<br>
1.) Some fixes to the Scanner infrastructure to support Morphs in Text better<br>
2.) Improvements to describe how a Morph should be aligned with regard to the text. Relevant methods on Morph are:<br>
#textAnchorVerticalAlignment:<br>
#textAnchorPadding:<br>
#textAnchorConsumesHorizontalSpace:<br>
<br>
You can see an example by executing the body of the test:<br>
TextAnchorTest>>#testHavingAnAnchorCanBeAlignedDifferently<br>
<br>
!Warning: As this touches Scanner code a lot, loading this change set might make your image unresponsive!<br>
<br>
I would like to point out that the test cases are preliminary and a few of the methods still require polishing. Nevertheless, I would like to ask for comments on the change set, in particular regarding:<br>
1.) Should the alignment information be stored in the Morph or the TextAnchorAttribute? Currently the information is stored in the Morph which parallels LayoutProperties.<br></blockquote><div>I think it should be in Morph, because Morph can have its own notion of baseline etc... (imagine for example that I want to render a FractionMathMorph 1/(1/x+1), then I want the main (upper) fraction bar to be somehow aligned with the text baseline)</div><div>If Morph does not carry such information, then we can wrap in another Morph that does (but I'm not sure that's how Morph works currently...)<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
2.) Is using caseOf: in Scanner code fine? I suspect it to be quite expensive which is probably not a good thing in Scanners?<br></blockquote><div>unless you have thousands of Morphs, you won't be able to measure any difference<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
3.) Should the cursor allow users to navigate (or select?) the "start of header" character that is used to denote the text anchor placement?<br></blockquote><div>If Morph is aligned with text (renderd as if a single character), then i would expect so (so as to be able to copy/paste for example)</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
4.) Does anyone remember / know what the textAnchorType was intended for? The previous implementation largely ignored it and this one does so too.<br></blockquote><div>I guess it could be like classical editors: Morph aligned with text (as a single character) or super-imposed over text, or text wraps around the morph, or ...</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Thanks and best wishes,<br>
Patrick <br>
</blockquote></div></div>