The Trunk: Morphic-mt.827.mcz

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

The Trunk: Morphic-mt.827.mcz

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

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

Name: Morphic-mt.827
Author: mt
Time: 6 April 2015, 3:02:38.867 pm
UUID: f431d9b2-5786-5d4e-94ae-88f16b811845
Ancestors: Morphic-mt.826

Fixed menu positioning bug (which occured in the Squeak-menu with soft shadows enabled).

Always do layout using your bounds or innerBounds (or even outerBounds) but never fullBounds, which is only an internal layout cache.

=============== Diff against Morphic-mt.826 ===============

Item was changed:
  ----- Method: MenuMorph>>popUpAdjacentTo:forHand:from: (in category 'control') -----
  popUpAdjacentTo: rightOrLeftPoint forHand: hand from: sourceItem
  "Present this menu at the given point under control of the given hand."
 
  | tryToPlace selectedOffset rightPoint leftPoint |
  hand world startSteppingSubmorphsOf: self.
  popUpOwner := sourceItem.
 
  self fullBounds.
  self updateColor.
+
-
  "ensure layout is current"
  selectedOffset := (selectedItem
  ifNil: [self items first]) position - self position.
  tryToPlace := [:where :mustFit | | delta |
  self position: where - selectedOffset.
+ delta := self boundsInWorld amountToTranslateWithin: sourceItem worldBounds.
- delta := self fullBoundsInWorld amountToTranslateWithin: sourceItem worldBounds.
  (delta x = 0
  or: [mustFit])
  ifTrue: [delta = (0 @ 0)
  ifFalse: [self position: self position + delta].
  sourceItem owner owner addMorphFront: self.
  ^ self]].
  rightPoint := rightOrLeftPoint first + ((self layoutInset + self borderWidth) @ 0).
  leftPoint := rightOrLeftPoint last - ((self layoutInset + self borderWidth + self width) @ 0).
  tryToPlace
  value: rightPoint value: false;
  value: leftPoint value: false;
  value: rightPoint value: true.!