<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><font size="4">Hi Ian, <br>
      </font></p>
    <p><font size="4">It is so cool to read about people developing
        stuff with Cuis. I hope you will continue to do so,
        Cuis-Smalltalk is a very pleasant system to explore and to
        develop new ideas.</font></p>
    <p><font size="4">On the issue you reported </font><font size="4">related
        to the scaled Morph moving out of sight</font><font size="4">,
        which I am not 100% sure to understand, I don't master well
        subtle English; I think it is related to the fact that the
        scaleBy: use as a center the origin of the scaled Morph. For the
        record the scale is a homothety[1] geometric transformation and
        its requires two parameters: the scaling factor and a point, the
        center of the homothety. By default, in Cuis, this last one is
        set as the origin of the Morph coordinates system.<br>
      </font></p>
    <p><font size="4">Take an example, the two same Morph rectangles
        defined with points:</font></p>
    <ul>
      <li><font size="4">(0 ; 0) (6 ; 0) (6 ; 2) (0 ; 2)</font></li>
      <li><font size="4">(-3 ; -1) (3 ; -1) (3 ; 1) (-3 ; 1)</font></li>
    </ul>
    <p><font size="4">In the first rectangle, the origin in the Morph
        coordinates system is the top left point, in the second
        rectangle it is the center of the Rectangle (intersection of its
        two diagonals) </font><br>
    </p>
    <p><font size="4">When scaling, the first one is scaled from the its
        top left summit; the second one is scaled from the center of the
        rectangle. It will result in two different rectangles.</font><br>
    </p>
    <p><font size="4">Filein the source file included in this message
        and execute in a Workspace the code below:</font></p>
    <p><!-- HTML generated using hilite.me --></p>
    <div
style="background: #ffffff; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;">
      <pre style="margin: 0; line-height: 125%"><span
      style="color: #333333">|</span><span style="color: #996633"> rect1 rect2 </span><span
      style="color: #333333">|</span>
<span style="color: #996633">rect1</span> <span style="color: #333333">:=</span> <span
      style="color: #BB0066; font-weight: bold">Rectangle1Morph</span> <span
      style="color: #007020">new</span> <span
      style="color: #0066BB; font-weight: bold">openInWorld</span>.
<span style="color: #996633">rect2</span> <span style="color: #333333">:=</span> <span
      style="color: #BB0066; font-weight: bold">Rectangle2Morph</span> <span
      style="color: #007020">new</span> <span
      style="color: #0066BB; font-weight: bold">openInWorld</span>.
<span style="color: #996633">rect1</span> <span
      style="color: #0066BB; font-weight: bold">morphPosition:</span> <span
      style="color: #BB0066; font-weight: bold">DisplayScreen</span> <span
      style="color: #0066BB; font-weight: bold">actualScreenSize</span> <span
      style="color: #0066BB; font-weight: bold">//</span> <span
      style="color: #6600EE; font-weight: bold">2</span> <span
      style="color: #0066BB; font-weight: bold">-</span> (<span
      style="color: #6600EE; font-weight: bold">60</span><span
      style="color: #0066BB; font-weight: bold">@</span><span
      style="color: #6600EE; font-weight: bold">20</span>). <span
      style="color: #888888">"needed adjustment because different origin"</span>
<span style="color: #996633">rect2</span> <span
      style="color: #0066BB; font-weight: bold">morphPosition:</span> <span
      style="color: #BB0066; font-weight: bold">DisplayScreen</span> <span
      style="color: #0066BB; font-weight: bold">actualScreenSize</span> <span
      style="color: #0066BB; font-weight: bold">//</span> <span
      style="color: #6600EE; font-weight: bold">2</span>.
<span style="color: #996633">rect1</span> <span
      style="color: #0066BB; font-weight: bold">scaleBy:</span> <span
      style="color: #6600EE; font-weight: bold">2</span>.
<span style="color: #996633">rect2</span> <span
      style="color: #0066BB; font-weight: bold">scaleBy:</span> <span
      style="color: #6600EE; font-weight: bold">2</span>.

<span style="color: #888888">"</span>
<span style="color: #888888">Rectangle1Morph allInstancesDo: [:each | each delete].</span>
<span style="color: #888888">Rectangle2Morph allInstancesDo: [:each | each delete].</span>
<span style="color: #888888">"</span>
</pre>
    </div>
    <p><font size="4">Affine transformations should be used and composed
        with translations and scale but I can't get a code snipped
        working yet. You could then extent your morph with the
        appropriate protocol.<br>
      </font></p>
    <p><font size="4">Hilaire<br>
      </font></p>
    <p><font size="4"><br>
      </font></p>
    <p><font size="4">[1] <a class="moz-txt-link-freetext" href="https://en.wikipedia.org/wiki/Homothety">https://en.wikipedia.org/wiki/Homothety</a><br>
      </font></p>
    <pre class="moz-signature" cols="72">-- 
GNU Dr. Geo
<a class="moz-txt-link-freetext" href="http://gnu.org/s/dr-geo/">http://gnu.org/s/dr-geo/</a>
<a class="moz-txt-link-freetext" href="http://gnu-drgeo.blogspot.com/">http://gnu-drgeo.blogspot.com/</a></pre>
  </body>
</html>