<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 11/30/2021 3:34 PM, Hilaire Fernandes via Cuis-dev wrote:
<blockquote cite="mid:82eec656-2ca4-2ec8-af55-81c042a684e2@drgeo.eu"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<p><font size="+1">Ok. I check your cs, so we can now simplify
again drawOn: by inheriting the behavior.</font></p>
<p><font size="+1">Here is the changeset.<br>
</font></p>
<p><font size="+1"> </font>Thanks</p>
<p>Hilaire<br>
</p>
<div class="moz-cite-prefix">Le 30/11/2021 à 18:32, Juan Vuletich
via Cuis-dev a écrit :<br>
</div>
<blockquote type="cite" cite="mid:61A66014.7070104@jvuletich.org"><br>
Thanks. I tweaked your code to also avoid the last line if it
can't be shown complete. Now at GitHub.<br>
</blockquote>
<pre class="moz-signature" cols="72">--
GNU Dr. Geo
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://drgeo.eu">http://drgeo.eu</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://blog.drgeo.eu">http://blog.drgeo.eu</a></pre>
</blockquote>
<br>
The first version I tried did that, and also avoided the last line
even if just the white space below the glyphs was at risk. But when
resizing the example, it looked like it was removing the last line
"too early", when it could still be displayed perfectly.<br>
<br>
The version I pushed only avoids the last line only if the baseline
(the bottom of regular glyphs) would lie outside bounds. This means
that occasionally glyph descenders could go outside bounds. That's
why I kept the "border over text" code. Anyway, the difference is
minimal, and the inherited version would also be ok.<br>
<br>
You might want to play a bit with the alternatives. In
#textComposition:bounds:color:selectionColor:avoidOverhang: you can
alternate between<br>
(strict not or: [ line top + line baseline <
possibleVisibleLocalRect bottom ]) ifTrue: [<br>
and<br>
(strict not or: [ line bottom <
possibleVisibleLocalRect bottom ]) ifTrue: [<br>
<br>
These deails are easily visible if you set a TT font and zoom the
TextParagraphMorph.<br>
<br>
Cheers,<br>
<pre class="moz-signature" cols="72">--
Juan Vuletich
<a class="moz-txt-link-abbreviated" href="http://www.cuis-smalltalk.org">www.cuis-smalltalk.org</a>
<a class="moz-txt-link-freetext" href="https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev">https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev</a>
<a class="moz-txt-link-freetext" href="https://github.com/jvuletich">https://github.com/jvuletich</a>
<a class="moz-txt-link-freetext" href="https://www.linkedin.com/in/juan-vuletich-75611b3">https://www.linkedin.com/in/juan-vuletich-75611b3</a>
@JuanVuletich</pre>
</body>
</html>