The Trunk: Graphics-mt.446.mcz

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

The Trunk: Graphics-mt.446.mcz

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

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

Name: Graphics-mt.446
Author: mt
Time: 18 February 2021, 4:07:36.927082 pm
UUID: 7970ec57-0257-ff4c-a2e3-13d3e06d4807
Ancestors: Graphics-dtl.445

Adds new version for LayoutFrame to be able to convert old versions with 'nil' fields.

=============== Diff against Graphics-dtl.445 ===============

Item was changed:
  ----- Method: LayoutFrame class>>classVersion (in category 'accessing') -----
  classVersion
+ ^ 2 "fractions and offsets are never 'nil' anymore"
- ^1 "changed treatment of bottomOffset and rightOffset"
  !

Item was added:
+ ----- Method: LayoutFrame class>>withClassVersion: (in category 'objects from disk') -----
+ withClassVersion: aVersion
+
+ aVersion <= self classVersion ifTrue: [^ self].
+ ^ super withClassVersion: aVersion!

Item was changed:
  ----- Method: LayoutFrame>>convertToCurrentVersion:refStream: (in category 'objects from disk') -----
  convertToCurrentVersion: varDict refStream: smartRefStrm
  | className oldClassVersion |
 
  "JW 2/1/2001"
  "Since class version isn't passed in varDict, look it up through smartRefSrm."
  className := varDict at: #ClassName.
  oldClassVersion := (smartRefStrm structures at: className) first.
+ (oldClassVersion = 0) ifTrue: [ self negateBottomRightOffsets; fixup ].
+ (oldClassVersion = 1) ifTrue: [ self fixup ].
- (oldClassVersion = 0) ifTrue: [ self negateBottomRightOffsets ].
  ^super convertToCurrentVersion: varDict refStream: smartRefStrm.
  !

Item was changed:
+ ----- Method: LayoutFrame>>fixup (in category 'objects from disk') -----
- ----- Method: LayoutFrame>>fixup (in category 'initialize-release') -----
  fixup
  "Set-up default value for un-initialized layout frames"
 
  "LayoutFrame allInstancesDo: [:e | e fixup]."
 
  leftFraction ifNil: [leftFraction := 0].
  leftOffset ifNil: [leftOffset := 0].
  topFraction ifNil: [topFraction := 0].
  topOffset ifNil: [topOffset := 0].
  rightFraction ifNil: [rightFraction := 0].
  rightOffset ifNil: [rightOffset := 0].
  bottomFraction ifNil: [bottomFraction := 0].
  bottomOffset ifNil: [bottomOffset := 0].!