The Trunk: Morphic-mt.1590.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Morphic-mt.1590.mcz

commits-2
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1590.mcz

==================== Summary ====================

Name: Morphic-mt.1590
Author: mt
Time: 20 November 2019, 4:18:13.982237 pm
UUID: ecbe5a17-bdc5-554e-a2dc-d29638ee6752
Ancestors: Morphic-mt.1589

Fixes a bug with splitter positioning under certain conditions in the PropotionalLayout.

=============== Diff against Morphic-mt.1589 ===============

Item was added:
+ ----- Method: BorderedMorph>>addPaneHSplitterAtBottomOfRow: (in category 'resize handling') -----
+ addPaneHSplitterAtBottomOfRow: someMorphs
+
+ | targetY minX maxX splitter |
+ targetY := someMorphs first layoutFrame bottomFraction.
+
+ minX := (someMorphs detectMin: [:each | each layoutFrame leftFraction]) layoutFrame leftFraction.
+ maxX := (someMorphs detectMax: [:each | each layoutFrame rightFraction]) layoutFrame rightFraction.
+
+ splitter := ProportionalSplitterMorph new beSplitsTopAndBottom; yourself.
+ splitter layoutFrame: (LayoutFrame
+ fractions: (minX @ targetY corner: maxX @ targetY)
+ offsets: (((someMorphs first layoutFrame leftOffset ifNil: [0]) @ 0
+ corner: (someMorphs first layoutFrame rightOffset ifNil: [0]) @ AbstractResizerMorph gripThickness)
+ translateBy: 0 @ (someMorphs first layoutFrame bottomOffset ifNil: [0]))).
+
+ self addMorphBack: (splitter position: self position).!

Item was removed:
- ----- Method: BorderedMorph>>addPaneHSplitterBetween:and: (in category 'resize handling') -----
- addPaneHSplitterBetween: topMorph and: bottomMorphs
-
- | targetY minX maxX splitter |
- targetY := topMorph layoutFrame bottomFraction.
-
- minX := (bottomMorphs detectMin: [:each | each layoutFrame leftFraction]) layoutFrame leftFraction.
- maxX := (bottomMorphs detectMax: [:each | each layoutFrame rightFraction]) layoutFrame rightFraction.
- splitter := ProportionalSplitterMorph new beSplitsTopAndBottom; yourself.
- splitter layoutFrame: (LayoutFrame
- fractions: (minX @ targetY corner: maxX @ targetY)
- offsets: (((topMorph layoutFrame leftOffset ifNil: [0]) @ 0
- corner: (topMorph layoutFrame rightOffset ifNil: [0]) @ AbstractResizerMorph gripThickness)
- translateBy: 0 @ (topMorph layoutFrame bottomOffset ifNil: [0]))).
-
- self addMorphBack: (splitter position: self position).!

Item was changed:
  ----- Method: BorderedMorph>>addPaneHSplitters (in category 'resize handling') -----
  addPaneHSplitters
 
  | remaining targetY sameY |
  remaining := self paneMorphs reject: [:each |
  each layoutFrame bottomFraction = 1
  or: [each layoutFrame hasFixedHeight]].
  [remaining notEmpty] whileTrue:
  [targetY := remaining first layoutFrame bottomFraction.
  sameY := self paneMorphs select: [:each | each layoutFrame bottomFraction = targetY].
+ self addPaneHSplitterAtBottomOfRow: sameY.
- self addPaneHSplitterBetween: remaining first and: sameY.
  remaining := remaining copyWithoutAll: sameY]!

Item was added:
+ ----- Method: BorderedMorph>>addPaneVSplitterAtRightOfColumn: (in category 'resize handling') -----
+ addPaneVSplitterAtRightOfColumn: someMorphs
+
+ | targetX minY maxY splitter |
+ targetX := someMorphs first layoutFrame rightFraction.
+ minY := (someMorphs detectMin: [:each | each layoutFrame topFraction]) layoutFrame topFraction.
+ maxY := (someMorphs detectMax: [:each | each layoutFrame bottomFraction]) layoutFrame bottomFraction.
+
+ splitter := ProportionalSplitterMorph new.
+ splitter layoutFrame: (LayoutFrame
+ fractions: (targetX @ minY corner: targetX @ maxY)
+ offsets: ((0 @ (someMorphs first layoutFrame topOffset ifNil: [0]) corner: (AbstractResizerMorph gripThickness@ (someMorphs first layoutFrame bottomOffset ifNil: [0]))) translateBy: (someMorphs first layoutFrame rightOffset ifNil: [0]) @ 0)).
+
+ self addMorphBack: (splitter position: self position).!

Item was removed:
- ----- Method: BorderedMorph>>addPaneVSplitterBetween:and: (in category 'resize handling') -----
- addPaneVSplitterBetween: leftMorph and: rightMorphs
-
- | targetX minY maxY splitter |
- targetX := leftMorph layoutFrame rightFraction.
- minY := (rightMorphs detectMin: [:each | each layoutFrame topFraction]) layoutFrame topFraction.
- maxY := (rightMorphs detectMax: [:each | each layoutFrame bottomFraction]) layoutFrame bottomFraction.
-
- splitter := ProportionalSplitterMorph new.
- splitter layoutFrame: (LayoutFrame
- fractions: (targetX @ minY corner: targetX @ maxY)
- offsets: ((0 @ (leftMorph layoutFrame topOffset ifNil: [0]) corner: (AbstractResizerMorph gripThickness@ (leftMorph layoutFrame bottomOffset ifNil: [0]))) translateBy: (leftMorph layoutFrame rightOffset ifNil: [0]) @ 0)).
-
- self addMorphBack: (splitter position: self position).!

Item was changed:
  ----- Method: BorderedMorph>>addPaneVSplitters (in category 'resize handling') -----
  addPaneVSplitters
 
  | remaining targetX sameX |
  remaining := self paneMorphs reject: [:each |
  each layoutFrame rightFraction = 1
  or: [each layoutFrame hasFixedWidth]].
  [remaining notEmpty] whileTrue:
  [targetX := remaining first layoutFrame rightFraction.
  sameX := self paneMorphs select: [:each | each layoutFrame rightFraction = targetX].
+ self addPaneVSplitterAtRightOfColumn: sameX.
- self addPaneVSplitterBetween: remaining first and: sameX.
  remaining := remaining copyWithoutAll: sameX]!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Morphic-mt.1590.mcz

marcel.taeumel
Well, actually the method #addPaneHSplitterBetween:and: was badly named because it did not reveal the actual effect. After renaming it to #addPaneHSplitterAtBottomOfRow: and changing #addPaneHSplitters, the bug solved itself. :-)

Best,
Marcel

Am 20.11.2019 16:18:31 schrieb [hidden email] <[hidden email]>:

Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1590.mcz

==================== Summary ====================

Name: Morphic-mt.1590
Author: mt
Time: 20 November 2019, 4:18:13.982237 pm
UUID: ecbe5a17-bdc5-554e-a2dc-d29638ee6752
Ancestors: Morphic-mt.1589

Fixes a bug with splitter positioning under certain conditions in the PropotionalLayout.

=============== Diff against Morphic-mt.1589 ===============

Item was added:
+ ----- Method: BorderedMorph>>addPaneHSplitterAtBottomOfRow: (in category 'resize handling') -----
+ addPaneHSplitterAtBottomOfRow: someMorphs
+
+ | targetY minX maxX splitter |
+ targetY := someMorphs first layoutFrame bottomFraction.
+
+ minX := (someMorphs detectMin: [:each | each layoutFrame leftFraction]) layoutFrame leftFraction.
+ maxX := (someMorphs detectMax: [:each | each layoutFrame rightFraction]) layoutFrame rightFraction.
+
+ splitter := ProportionalSplitterMorph new beSplitsTopAndBottom; yourself.
+ splitter layoutFrame: (LayoutFrame
+ fractions: (minX @ targetY corner: maxX @ targetY)
+ offsets: (((someMorphs first layoutFrame leftOffset ifNil: [0]) @ 0
+ corner: (someMorphs first layoutFrame rightOffset ifNil: [0]) @ AbstractResizerMorph gripThickness)
+ translateBy: 0 @ (someMorphs first layoutFrame bottomOffset ifNil: [0]))).
+
+ self addMorphBack: (splitter position: self position).!

Item was removed:
- ----- Method: BorderedMorph>>addPaneHSplitterBetween:and: (in category 'resize handling') -----
- addPaneHSplitterBetween: topMorph and: bottomMorphs
-
- | targetY minX maxX splitter |
- targetY := topMorph layoutFrame bottomFraction.
-
- minX := (bottomMorphs detectMin: [:each | each layoutFrame leftFraction]) layoutFrame leftFraction.
- maxX := (bottomMorphs detectMax: [:each | each layoutFrame rightFraction]) layoutFrame rightFraction.
- splitter := ProportionalSplitterMorph new beSplitsTopAndBottom; yourself.
- splitter layoutFrame: (LayoutFrame
- fractions: (minX @ targetY corner: maxX @ targetY)
- offsets: (((topMorph layoutFrame leftOffset ifNil: [0]) @ 0
- corner: (topMorph layoutFrame rightOffset ifNil: [0]) @ AbstractResizerMorph gripThickness)
- translateBy: 0 @ (topMorph layoutFrame bottomOffset ifNil: [0]))).
-
- self addMorphBack: (splitter position: self position).!

Item was changed:
----- Method: BorderedMorph>>addPaneHSplitters (in category 'resize handling') -----
addPaneHSplitters

| remaining targetY sameY |
remaining := self paneMorphs reject: [:each |
each layoutFrame bottomFraction = 1
or: [each layoutFrame hasFixedHeight]].
[remaining notEmpty] whileTrue:
[targetY := remaining first layoutFrame bottomFraction.
sameY := self paneMorphs select: [:each | each layoutFrame bottomFraction = targetY].
+ self addPaneHSplitterAtBottomOfRow: sameY.
- self addPaneHSplitterBetween: remaining first and: sameY.
remaining := remaining copyWithoutAll: sameY]!

Item was added:
+ ----- Method: BorderedMorph>>addPaneVSplitterAtRightOfColumn: (in category 'resize handling') -----
+ addPaneVSplitterAtRightOfColumn: someMorphs
+
+ | targetX minY maxY splitter |
+ targetX := someMorphs first layoutFrame rightFraction.
+ minY := (someMorphs detectMin: [:each | each layoutFrame topFraction]) layoutFrame topFraction.
+ maxY := (someMorphs detectMax: [:each | each layoutFrame bottomFraction]) layoutFrame bottomFraction.
+
+ splitter := ProportionalSplitterMorph new.
+ splitter layoutFrame: (LayoutFrame
+ fractions: (targetX @ minY corner: targetX @ maxY)
+ offsets: ((0 @ (someMorphs first layoutFrame topOffset ifNil: [0]) corner: (AbstractResizerMorph gripThickness@ (someMorphs first layoutFrame bottomOffset ifNil: [0]))) translateBy: (someMorphs first layoutFrame rightOffset ifNil: [0]) @ 0)).
+
+ self addMorphBack: (splitter position: self position).!

Item was removed:
- ----- Method: BorderedMorph>>addPaneVSplitterBetween:and: (in category 'resize handling') -----
- addPaneVSplitterBetween: leftMorph and: rightMorphs
-
- | targetX minY maxY splitter |
- targetX := leftMorph layoutFrame rightFraction.
- minY := (rightMorphs detectMin: [:each | each layoutFrame topFraction]) layoutFrame topFraction.
- maxY := (rightMorphs detectMax: [:each | each layoutFrame bottomFraction]) layoutFrame bottomFraction.
-
- splitter := ProportionalSplitterMorph new.
- splitter layoutFrame: (LayoutFrame
- fractions: (targetX @ minY corner: targetX @ maxY)
- offsets: ((0 @ (leftMorph layoutFrame topOffset ifNil: [0]) corner: (AbstractResizerMorph gripThickness@ (leftMorph layoutFrame bottomOffset ifNil: [0]))) translateBy: (leftMorph layoutFrame rightOffset ifNil: [0]) @ 0)).
-
- self addMorphBack: (splitter position: self position).!

Item was changed:
----- Method: BorderedMorph>>addPaneVSplitters (in category 'resize handling') -----
addPaneVSplitters

| remaining targetX sameX |
remaining := self paneMorphs reject: [:each |
each layoutFrame rightFraction = 1
or: [each layoutFrame hasFixedWidth]].
[remaining notEmpty] whileTrue:
[targetX := remaining first layoutFrame rightFraction.
sameX := self paneMorphs select: [:each | each layoutFrame rightFraction = targetX].
+ self addPaneVSplitterAtRightOfColumn: sameX.
- self addPaneVSplitterBetween: remaining first and: sameX.
remaining := remaining copyWithoutAll: sameX]!