The Trunk: Morphic-mt.1730.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.1730.mcz

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

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

Name: Morphic-mt.1730
Author: mt
Time: 2 March 2021, 11:01:40.072687 am
UUID: 5fa729ff-1ebb-3a4e-8283-f88485971bd6
Ancestors: Morphic-mt.1729

A fix and a tweak.

(Note that it is interesting that damage-recording-based drawing via #changed and deferred layout computation via #layoutChanged are in conflict with each other. Also see #privateInvalidateMorph: and its senders.)

=============== Diff against Morphic-mt.1729 ===============

Item was changed:
  ----- Method: Morph>>position: (in category 'geometry') -----
  position: aPoint
  "Change the position of this morph, which is the top left corner of its bounds."
 
  | delta box |
  delta := (aPoint - self bounds topLeft) rounded.
 
  "Skip drawing and layout updates for null changes."
  (delta x = 0 and: [delta y = 0])
  ifTrue: [^ self].
 
  "Optimize drawing. Record one damage rectangle for short distance and two damage rectangles for large distances."
+ box := fullBounds ifNil: [self outerBounds]. "Avoid premature layout computation. Like in #extent: and #changed."
- box := self fullBounds.
  (delta dotProduct: delta) > 100 "More than 10 pixels?"
  ifTrue: [self
  invalidRect: box;
  invalidRect: (box translateBy: delta)]
  ifFalse: [self
  invalidRect: (box merge: (box translateBy: delta))].
 
  "Move this morph and *all* of its submorphs."
  self privateFullMoveBy: delta.
 
  "For all known layout policies, my layout and the layout of my children is fine. Only the layout of my owner might be affected. So, tell about it."
  self owner ifNotNil: [:o |
  self flag: #todo. "mt: Maybe we can save a lot of effort and troubles by only calling #layoutChanged if the owner has a layout policy installed? Take the thumbs of scroll-bars as an example..."
  o layoutChanged].!

Item was changed:
  ----- Method: Morph>>setToAdhereToEdge: (in category 'menus') -----
  setToAdhereToEdge: anEdge
  anEdge ifNil: [^ self].
  anEdge == #none ifTrue: [^ self removeProperty: #edgeToAdhereTo].
  self setProperty: #edgeToAdhereTo toValue: anEdge.
+ self layoutChanged.
  !