#7400 NORM Never A: morphicLayerNumber

Zarro Boogs per Child bugtracker at laptop.org
Tue Jul 1 10:35:04 EDT 2008


#7400: morphicLayerNumber
------------------------------------------------+---------------------------
 Reporter:  dmoco                               |         Owner:  etoys         
     Type:  defect                              |        Status:  new           
 Priority:  normal                              |     Milestone:  Never Assigned
Component:  etoys-activity                      |       Version:  Update.1      
 Keywords:  morph morphicLayerNumber submorphs  |   Next_action:  never set     
 Verified:  0                                   |     Blockedby:                
 Blocking:                                      |  
------------------------------------------------+---------------------------
 The following method only works for a worlds immediate submorphs:

 {{{
 Morph>>addMorphInLayer: aMorph

         submorphs do: [ :each |
                 each == aMorph ifTrue: [^self].
                 aMorph morphicLayerNumber < each morphicLayerNumber
 ifTrue: [
                         ^self addMorph: aMorph inFrontOf: each
                 ].
         ].
         self addMorphBack: aMorph
 }}}

 The problem arises in the comparison above, specifically at "... each
 morphicLayerNumber" due to the way "morphicLayerNumber" is coded:

 {{{
 Morph>>morphicLayerNumber

         "helpful for insuring some morphs always appear in front of or
 behind others.
         smaller numbers are in front"

         ^(owner isNil or: [owner isWorldMorph]) ifTrue: [
                 self valueOfProperty: #morphicLayerNumber ifAbsent: [100]
         ] ifFalse: [
                 owner morphicLayerNumber
         ].

         "leave lots of room for special things"
 }}}

 Morph>>morphicLayerNumber ignores the possibility that the (parented)
 morph itself may have the property #morphicLayerNumber and instead reads
 the property from the parent. The result is that non-world submorphs
 cannot be correctly positioned according to their own layer number.

-- 
Ticket URL: <http://dev.laptop.org/ticket/7400>
One Laptop Per Child <http://laptop.org/>
OLPC bug tracking system


More information about the Bugs mailing list