Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0007685 [Squeak] Morphic major always 01-13-12 15:43 01-13-12 16:26
Reporter unoduetre View Status public  
Assigned To
Priority normal Resolution open  
Status new   Product Version 4.2
Summary 0007685: Two (maybe unrelated) bugs with morphs layout
Description Consider the following code (do not run it yet):

"step1"
morph1:=Morph new.
morph1 position: 100 @ 100.
morph1 extent: 100 @ 100.
morph1 color: Color blue.
morph1 layoutPolicy: TableLayout new.
morph1 openInWorld.

"step2"
morph2:=Morph new.
morph2 height: 75.
morph2 color: Color red.
morph2 hResizing: #spaceFill.
morph1 addMorph: morph2.

"step3"
morph3:=Morph new.
morph3 position: 175 @ 100.
morph3 height: 50.
morph3 color: Color green.
morph2 addMorph: morph3.

"step4"
morph1 width: morph1 width + 25.

"step5"
morph1 width: morph1 width + 25.

Now in the Workspace run step1, step2, step3 and step4, but do NOT run them at once. You should see what is in the image Bug1.gif (attached).
This is wrong because of
morph2 hResizing: #spaceFill.
Now if you do step5 you will see what is in the image Step5.gif
You should notice the big jump by 50 pixels (instead of 25).
The source of this bug is the following line

cellBounds = self fullBounds ifTrue:[^self]. "already up to date"

in Morph>>layoutInBounds:

Now please consider the second bug.
Run step1, step2, step3 at once in workspace.
You should see what is in the image Bug2.gif
Additional Information
Attached Files  Bug1.gif [^] (1,236 bytes) 01-13-12 15:43
 Step5.gif [^] (1,214 bytes) 01-13-12 15:44
 Bug2.gif [^] (1,663 bytes) 01-13-12 15:44

- Relationships

- Notes
(0014213 - 90 - 96 - 96 - 96 - 96 - 96)
unoduetre
01-13-12 15:46

Also notice what happens if you change steps 4 and 5 to:
morph1 width: morph1 width + 26.
 
(0014214 - 465 - 539 - 539 - 539 - 539 - 539)
unoduetre
01-13-12 16:26

Even after removing:

cellBounds = self fullBounds ifTrue:[^self]. "already up to date"

The following line still causes problems:

cellBounds extent = self fullBounds extent "nice fit"
ifTrue:[^self position: cellBounds origin].

The bug number 1 is removed by commenting both line, but I don't know if it is a good idea, because I don't know Morphic enough. Do those lines really speed things up? Are the conditions of this bug too specific to repair it?
 

- Issue History
Date Modified Username Field Change
01-13-12 15:43 unoduetre New Issue
01-13-12 15:43 unoduetre File Added: Bug1.gif
01-13-12 15:44 unoduetre File Added: Step5.gif
01-13-12 15:44 unoduetre File Added: Bug2.gif
01-13-12 15:46 unoduetre Note Added: 0014213
01-13-12 16:26 unoduetre Note Added: 0014214
01-13-12 16:49 lewis Issue Monitored: lewis


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
44 total queries executed.
29 unique queries executed.
Powered by Mantis Bugtracker