<div dir="ltr"><div dir="auto"><br><br><div class="gmail_quote"><div dir="ltr">On Mon, Dec 31, 2018, 10:56 tim Rowledge <<a href="mailto:tim@rowledge.org" target="_blank">tim@rowledge.org</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Neat stuff, but I do so hate to see #isKindOf:.<br>
<br>
<br>
> On 2018-12-31, at 3:29 AM, karl ramberg <<a href="mailto:karlramberg@gmail.com" rel="noreferrer" target="_blank">karlramberg@gmail.com</a>> wrote:<br>
> <br>
> TextMorph>>createParagraph<br>
> <br>
>     self setProperty: #CreatingParagraph toValue: true.<br>
> <br>
>     [<br>
>         self setDefaultContentsIfNil.<br>
> <br>
>         "...Code here to recreate the paragraph..."<br>
>         paragraph := (self paragraphClass new textOwner: self owner).<br>
>         paragraph wantsColumnBreaks: successor notNil.<br>
>         paragraph<br>
>             compose: text<br>
>             style: textStyle copy<br>
>             from: self startingIndex<br>
>             in: self container.<br>
>         (paragraph isKindOf: TextOnCurve)<br>
>         ifTrue:[<br>
>                 paragraph focused: (self currentHand keyboardFocus == self).<br>
>                 self fit.<br>
>                 self removeProperty: #CreatingParagraph.<br>
>                       ^ paragraph].<br>
>         wrapFlag ifFalse:<br>
>             ["Was given huge container at first... now adjust"<br>
>             paragraph adjustRightX].<br>
>         paragraph focused: (self currentHand keyboardFocus == self).<br>
>     <br>
>         self fit.<br>
>     ] ensure: [self removeProperty: #CreatingParagraph].<br>
> <br>
>     ^ paragraph<br>
<br>
That 'isKindOf: TextOnCurve' seems like it ought to be redundant. Both branches send #fit, focused; & removeProperty (in fact the ensure will make sure it happens twice for TextOnCurve instances) so it's hard to see what the intent is here.<br><br></blockquote><div>What the intent looks like is to avoid the #adjustRightX if the wrapFlag is not set - which is causing the error(s), at least when I tried it.</div><div><br></div><div>Another alternative might be to implement TextOnCurve>>adjustRightX to be a no-op (with a suitable comment) so that it didn't do anything in this case. Then the isKindOf: could go away.</div><div><br></div><div>And, Karl, thank you for tracking this down!</div><div><br></div><div>-cbc</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">what is<br>
tim<br>
--<br>
tim Rowledge; <a href="mailto:tim@rowledge.org" rel="noreferrer" target="_blank">tim@rowledge.org</a>; <a href="http://www.rowledge.org/tim" rel="noreferrer noreferrer" target="_blank">http://www.rowledge.org/tim</a><br>
Did you hear about Christopher Robin Hood? He stole from the rich to give to the Pooh<br>
<br>
<br>
<br>
</blockquote></div></div>
</div>