[Cuis-dev] Subtle situation with bounding box
Juan Vuletich
juan at cuis.st
Thu Sep 10 11:34:02 PDT 2026
Hi Hilaire,
Your code is almost correct. There's a deail you oversaw. In
#adjustBoundsTo: the first line must read:
translate := self internalizeDistance: (newBoundsInOwner origin - self
fullBoundsInOwner origin).
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:
With this patch, it works as expected.
Cheers!
On 2026-09-10 7:41 AM, Hilaire Fernandes via Cuis-dev wrote:
>
> Hi Juan,
>
> 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.
>
> 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.
>
> 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.
>
> 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.
>
> 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.
>
> 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.
>
> Thanks
>
>
> [1] The owner of both the picture and the hand strokes
>
> [2]
> https://www.dropbox.com/scl/fi/qsjw9q4fr7qewn8kleh24/Dybo.zip?rlkey=zv1louhzzoipzecpnuimm0nri&st=ljud0al7&dl=0
>
> --
> http://mamot.fr/@drgeo
>
--
Juan Vuletich
www.cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20260910/5105d5e2/attachment.htm>
More information about the Cuis-dev
mailing list