Hi everyone !

I'm playing around with horizontal scrolling of a submorph into a morph.
Let's take a simple horizontal scrolling to the left.
When the submorph is getting out of the left side of the  morph, it should reappear to the right side of the morph.
The problem is that during the "transition" the submorph is still visible outside of the morph.
So, I'm searching for a solution for the submorph not being visible outside the bounds of it's owner.

To visualize the problem, see code below.
(for an obscure reason, the transcript window must be opened, but that's not the point).

Thanks a lot for your help !!!!

Here is the sample code (don't forget to open the transcript window):



|m1 m2|

m1:=Morph new.
m1 extent:800@600.
m1 color:Color blue.
m1 center: Display center.
m1 openInWorld.

m2:=Morph new.
m2 extent:200@200.
m2 color:Color red.

m1 addMorph: m2.
m2 center: m1 center.

1 to:200 do:[:el|
|pos|
(Duration seconds:0.01) asDelay wait.
pos:=(m2 position x -5)@(m2 position y).
((pos x + m2 width) >= (m1 position x)) ifFalse:[
pos:=((m1 position x + m1 width)@ m2 position y).
].
Transcript show: (pos asString);cr.
m2 position:pos.
].