<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2013/3/5 Casey Ransberger <span dir="ltr">&lt;<a href="mailto:casey.obrien.r@gmail.com" target="_blank">casey.obrien.r@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I don&#39;t have access to an image often enough. Sounds like you might have an interesting bug. Would you post the two implementations, if they aren&#39;t long?<div class="">
<div class="h5"><br><br><div class="gmail_quote">On Mon, Mar 4, 2013 at 11:46 PM, Nicolai Hess <span dir="ltr">&lt;<a href="mailto:nicolaihess@gmail.com" target="_blank">nicolaihess@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div>Hi,<br><br>someone knows why Morphs selector x x: and y y: are<br>
implemented differently?<br>
<br></div>Morph y and y: testing wether self world is nil<br></div>whereas x and x: doesn&#39;t.<br>

<br></div>Btw. what is the preferred way to position morphs <span>relative</span><br></div>to the bounds of its owner. It seems morph positions are always<br></div>absolute coordinates.<br><br></div>regards<span><font color="#888888"><br>

</font></span></div><span><font color="#888888">
Nicolai<br></font></span></div>
<br><br>
<br></blockquote></div><br><br clear="all"><div><br></div></div></div><span class=""><font color="#888888">-- <br>Casey Ransberger
</font></span><br><br>
<br></blockquote></div><br><br></div><div class="gmail_extra">x: aNumber <br>    &quot;Set my horizontal position relative to the cartesian origin of the playfield or the world.&quot;<br><br>    | offset aPlayfield newX |<br>
    aPlayfield := self referencePlayfield.<br>
    offset := self left - self referencePosition x.<br>    newX := aPlayfield isNil<br>                ifTrue: [aNumber + offset]<br>                ifFalse: [aPlayfield cartesianOrigin x + aNumber + offset].<br>    self position: newX @ bounds top<br>

<br><br>y: aNumber <br>    &quot;Set my 
vertical position relative to the cartesian origin of the playfield or 
the world. Note that larger y values are closer to the top of the 
screen.&quot;<br>
<br>    | w offset newY aPlayfield |<br>    w := self world.<br>    w ifNil: [^self position: bounds left @ aNumber].<br>    aPlayfield := self referencePlayfield.<br>    offset := self top - self referencePosition y.<br>

    newY := aPlayfield isNil<br>                ifTrue: [w bottom - aNumber + offset]<br>                ifFalse: [aPlayfield cartesianOrigin y - aNumber + offset].<br>    self position: bounds left @ newY</div></div>