Skip to content

Commit

Permalink
all tests are green now (that does not means everything work, just th…
Browse files Browse the repository at this point in the history
…at we need more tests)
  • Loading branch information
estebanlm committed Sep 10, 2019
1 parent 124e650 commit 55ce0c8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
12 changes: 7 additions & 5 deletions src/Spec2-Adapters-Morphic/SpMorphicGridLayout.class.st
Expand Up @@ -55,20 +55,22 @@ SpMorphicGridLayout >> calculateExtentFor: aMorph constraint: constraint computa
{ #category : #private }
SpMorphicGridLayout >> calculateHeightFor: aMorph base: aNumber [

self isRowHomogeneous ifTrue: [ ^ aNumber ].
"self isRowHomogeneous ifTrue: [ ^ aNumber ].
aMorph vResizing = #spaceFill ifTrue: [ ^ aNumber ].
^ aMorph height
^ aMorph height"
^ aNumber
]

{ #category : #private }
SpMorphicGridLayout >> calculateWidthFor: aMorph base: aNumber [

self isColumnHomogeneous ifTrue: [ ^ aNumber ].
"self isColumnHomogeneous ifTrue: [ ^ aNumber ].
aMorph hResizing = #spaceFill ifTrue: [ ^ aNumber ].
^ aMorph width
^ aMorph width"
^ aNumber
]

{ #category : #'as yet unclassified' }
{ #category : #accessing }
SpMorphicGridLayout >> columnConstraintsAt: aNumber [

^ layout columnConstraintsAt: aNumber
Expand Down
30 changes: 15 additions & 15 deletions src/Spec2-Morphic-Backend-Tests/SpMorphicGridLayoutTest.class.st
Expand Up @@ -231,12 +231,12 @@ SpMorphicGridLayoutTest >> testColumnNotHomogeneousDiferentRowsAndColumns [
self place: morph2 at: 4@4.

layout := self newLayout.
layout layout columnHomogeneous: false.
layout layout beColumnNotHomogeneous.
"make columns differ, to make each column different"
label1 width: 30.
morph1 width: 40.
label2 width: 50.
morph2 width: 60.
(self styleExtent: 30@20) applyTo: label1.
(self styleExtent: 40@20) applyTo: morph1.
(self styleExtent: 50@20) applyTo: label2.
(self styleExtent: 60@20) applyTo: morph2.

layout layout: panel in: (0@0 corner: 100@100).

Expand All @@ -249,7 +249,7 @@ SpMorphicGridLayoutTest >> testColumnNotHomogeneousDiferentRowsAndColumns [

{ #category : #tests }
SpMorphicGridLayoutTest >> testColumnNotHomogeneousPairedRowsAndColumns [
"Paired elements in a rows and columns
"Paired elements in rows and columns
-----------
| 50 | 60 |
Expand All @@ -266,19 +266,19 @@ SpMorphicGridLayoutTest >> testColumnNotHomogeneousPairedRowsAndColumns [
self place: morph2 at: 2@2.

layout := self newLayout.
layout layout columnHomogeneous: false.
layout layout beColumnNotHomogeneous.
"make columns differ, to make each column different"
label1 width: 30.
morph1 width: 40.
label2 width: 50.
morph2 width: 60.
(self styleExtent: 30@20) applyTo: label1.
(self styleExtent: 50@20) applyTo: morph1.
(self styleExtent: 40@20) applyTo: label2.
(self styleExtent: 60@20) applyTo: morph2.

layout layout: panel in: (0@0 corner: 100@100).

self assert: label1 bounds equals: (0@0 corner: 50@20).
self assert: morph1 bounds equals: (50@0 corner: 110@20).
self assert: label2 bounds equals: (0@20 corner: 50@40).
self assert: morph2 bounds equals: (50@20 corner: 110@40)
self assert: label1 bounds equals: (0@0 corner: 40@20).
self assert: morph1 bounds equals: (40@0 corner: 100@20).
self assert: label2 bounds equals: (0@20 corner: 40@40).
self assert: morph2 bounds equals: (40@20 corner: 100@40)

]

Expand Down

0 comments on commit 55ce0c8

Please sign in to comment.