The Trunk: Morphic-ct.1505.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-ct.1505.mcz

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

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

Name: Morphic-ct.1505
Author: ct
Time: 15 August 2019, 12:19:25.5494 am
UUID: f62b8344-5c2e-844a-8472-cebd9bf52cf4
Ancestors: Morphic-mt.1504

Respect global scaleFactor in HaloMorphs

And apply some refactoring on #basicBox :)

=============== Diff against Morphic-mt.1504 ===============

Item was changed:
  ----- Method: HaloMorph>>addHandlesForWorldHalos (in category 'private') -----
  addHandlesForWorldHalos
  "Add handles for world halos, like the man said"
 
  | box w |
  w := self world ifNil:[target world].
  self removeAllMorphs.  "remove old handles, if any"
  self bounds: target bounds.
  box := w bounds insetBy: self handleSize // 2.
  target addWorldHandlesTo: self box: box.
 
  Preferences uniqueNamesInHalos ifTrue:
  [innerTarget assureExternalName].
+ self
+ addNameBeneath: ((box insetBy: (0@0 corner: 0@10))
+ scaleBy: RealEstateAgent scaleFactor)
+ string: innerTarget externalName.
- self addNameBeneath: (box insetBy: (0@0 corner: 0@10)) string: innerTarget externalName.
  growingOrRotating := false.
  self layoutChanged.
  self changed.
  !

Item was changed:
  ----- Method: HaloMorph>>basicBox (in category 'private') -----
  basicBox
+ | minSide outset anExtent aBox w |
- | aBox minSide anExtent w |
  minSide := 4 * self handleSize.
+ outset := 8 * RealEstateAgent scaleFactor.
+ anExtent := (self extent + self handleSize + outset) max: minSide asPoint.
- anExtent := ((self width + self handleSize + 8) max: minSide) @
- ((self height + self handleSize + 8) max: minSide).
  aBox := Rectangle center: self center extent: anExtent.
  w := self world ifNil:[target outermostWorldMorph].
  ^ w
  ifNil:
  [aBox]
  ifNotNil:
  [aBox intersect: (w viewBox insetBy: self handleSize // 2)]
  !

Item was changed:
  ----- Method: HaloMorph>>createHandleAt:color:iconName: (in category 'private') -----
  createHandleAt: aPoint color: aColor iconName: iconName
  | bou handle |
  bou := Rectangle center: aPoint extent: self handleSize asPoint.
  Preferences alternateHandlesLook
  ifTrue: [handle := RectangleMorph newBounds: bou color: aColor.
  handle useRoundedCorners.
  self setColor: aColor toHandle: handle]
  ifFalse: [handle := EllipseMorph newBounds: bou color: aColor].
  handle borderWidth: 0;
  wantsYellowButtonMenu: false.
  ""
  iconName isNil
  ifFalse: [| form |
  form := ScriptingSystem formAtKey: iconName.
  form isNil
  ifFalse: [| image |
  image := ImageMorph new.
+ image image: (form magnifyBy: RealEstateAgent scaleFactor).
- image image: form.
  image color: aColor makeForegroundColor.
  image lock.
  handle addMorphCentered: image]].
  ""
  ^ handle!

Item was changed:
  ----- Method: HaloMorph>>handleSize (in category 'private') -----
  handleSize
+ ^ (Preferences biggerHandles
- ^ Preferences biggerHandles
  ifTrue: [30]
+ ifFalse: [16]) * RealEstateAgent scaleFactor!
- ifFalse: [16]!