<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Hi Hilaire,</p>
    <p>Your code is almost correct. There's a deail you oversaw. In
      #adjustBoundsTo: the first line must read:</p>
    <p>translate := self internalizeDistance: (newBoundsInOwner origin -
      self fullBoundsInOwner origin).</p>
    <p>The reason is that both newBoundsInOwner and fullBoundsInOwner
      are in our owner's coordinate system, but submorphs live in our
      own coordinate system. So the distance needs to be converted from
      owner's to own coordinates. This is done with
      #internalizeDistance:</p>
    <p>With this patch, it works as expected.</p>
    <p>Cheers!</p>
    <div class="moz-cite-prefix">On 2026-09-10 7:41 AM, Hilaire
      Fernandes via Cuis-dev wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:7f785f4c-f76a-4c30-aa65-1db103dc488c@free.fr">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <p><font size="4">Hi Juan, </font></p>
      <p><font size="4">I have a situation which I think is related to
          the internal of Morph. The issue may just be a bad
          understanding from my part.</font></p>
      <p><font size="4">When I import a picture in a document, I can
          annotate it with hand strokes. An annotation can go outside of
          the picture surface, it is legitimate. Therefore, the bounding
          box of the encompassing annotator morph[1] is updated after
          each change in the annotator. Its methods #adjustBounds does
          just that. The odd part is that I need to send this message
          several times to get the bounds right.</font></p>
      <p><font size="4">In the image[2], in the document, hover the
          picture on its sides to display the bounding box of its
          annotator morph, you see it is not right, while its
          #adjustBounds was sent after the highlighter strokes. In the
          inspector, there are several messages to try to observe the
          issue.</font></p>
      <p><font size="4">The last message call in the inspector will set
          the bounds right, but it needs to be sent several times,
          although it was already sent by the App.</font></p>
      <p><font size="4">You can try to annotate by yourself the picture:
          use a pen or highlighter, then again select the drag tool (the
          hand icon) to show its the bounding box as I explained
          earlier.</font></p>
      <p><font size="4">I do not observe this bug when I am annotating
          DKM. I suspect the issue may be related to the fact the image
          may be scaled independently of the document.</font></p>
      <p><font size="4">Thanks</font></p>
      <p><font size="4"><br>
        </font></p>
      <p><font size="4">[1] The owner of both the picture and the hand
          strokes</font></p>
      <p><font size="4">[2]
          <a class="moz-txt-link-freetext"
href="https://www.dropbox.com/scl/fi/qsjw9q4fr7qewn8kleh24/Dybo.zip?rlkey=zv1louhzzoipzecpnuimm0nri&st=ljud0al7&dl=0"
            moz-do-not-send="true">https://www.dropbox.com/scl/fi/qsjw9q4fr7qewn8kleh24/Dybo.zip?rlkey=zv1louhzzoipzecpnuimm0nri&st=ljud0al7&dl=0</a></font></p>
      <pre class="moz-signature" cols="72">-- 
<a class="moz-txt-link-freetext" href="http://mamot.fr/@drgeo"
      moz-do-not-send="true">http://mamot.fr/@drgeo</a></pre>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Juan Vuletich
<a class="moz-txt-link-abbreviated" href="http://www.cuis.st">www.cuis.st</a>
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich</pre>
  </body>
</html>