<div dir="ltr">Drawing graphical elements of a simple, non-container, Morph are in local coordinates. Keyboard and mouse events passed to the Morph would also be in local coordinates.<div></div><br><div>About the only time when you, or your morph, would need to worry about internalizing/externalizing is when you are specifically dealing with Morph containers/containment (i.e. implementing a World, scrolling/virtual views, etc.) The basic idea is that the parent or child needing to work inward/outward would convert the coordinates to the local coordinates of its children/parent so that when they are told to draw or handle input events they can work in local coordinates, from their perspective.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Dec 22, 2019 at 11:02 AM Thierry Goubier via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Ken,<br>
<br>
thanks, I noticed that coordinates are local to the morph origin.<br>
<br>
But I see code where they are local to the owner origin (and hence the<br>
reason for Morph>>#externalize, Morph>>#internalize); this also shows<br>
up in the event processing (where you have all those methods with an<br>
additional parameter, #localPoint:) and in<br>
Morph>>#containsPoint:event: where you have a call to #internalize:...<br>
<br>
Or is that the Morphic API does not properly isolate the programmer<br>
from the specifics of the coordinate system used? The API should take<br>
care of all the internalize/externalize, right?<br>
<br>
At the moment, I'm writing quite a lot of code where I have to<br>
remember to add all those externalize / internalize calls all over the<br>
place. And I have the feeling I should not have to do that.<br>
<br>
Thierry<br>
<br>
Le dim. 22 déc. 2019 à 16:48, <<a href="mailto:ken.dickey@whidbey.com" target="_blank">ken.dickey@whidbey.com</a>> a écrit :<br>
><br>
> On 2019-12-22 07:16, Thierry Goubier via Cuis-dev wrote:<br>
> > Dear Cuis-er,<br>
> ><br>
> > I'm finding the Cuis Morphic coordinate system interesting, and I want<br>
> > a suggestion: what code convention do you use to remember your points<br>
> > are:<br>
> > - in the world coordinate system,<br>
> > - in the owner coordinate system,<br>
> > - in the morph instance coordinate system<br>
> > - in another referential than the three above (the owner owner<br>
> > coordinate system, for example) ?<br>
> ><br>
> > Regards,<br>
> ><br>
> > Thierry<br>
><br>
> SImple.<br>
><br>
> All morph coordinate locations are relative to their container.<br>
><br>
> FYI,<br>
> -KenD<br>
-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div>