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

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

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

Name: Morphic-mt.1544
Author: mt
Time: 26 September 2019, 11:26:14.016433 am
UUID: c3372aee-2104-9049-a6ef-4faa1f0eb079
Ancestors: Morphic-mt.1543

If you happen to end up with a TransformationMorph that has no children, you can now:

- open a halo on it to move/resize/delete it
- drag-and-drop it around in the world without a debugger nagging you

=============== Diff against Morphic-mt.1543 ===============

Item was changed:
  ----- Method: HaloMorph>>addScaleHandle: (in category 'handles') -----
  addScaleHandle: haloSpec
+
+ (target isFlexMorph and: [target renderedMorph ~~ target])
+ ifTrue: [(self addHandle: haloSpec
+ on: #mouseDown send: #startScale:with: to: self)
+ on: #mouseMove send: #doScale:with: to: self]
+ ifFalse: [(self addHandle: haloSpec
+ on: #mouseDown send: #startGrow:with: to: self)
+ on: #mouseMove send: #doGrow:with: to: self].
- target isFlexMorph ifTrue:
- [(self addHandle: haloSpec
- on: #mouseDown send: #startScale:with: to: self)
- on: #mouseMove send: #doScale:with: to: self].
- "This or addGrowHandle:, but not both, will prevail at any one time"
  !

Item was changed:
  ----- Method: HaloMorph>>addSimpleHandlesTo:box: (in category 'halos and balloon help') -----
  addSimpleHandlesTo: aHaloMorph box: aBox
  | aHandle |
  simpleMode := true.
 
  target isWorldMorph ifTrue: [^ self addSimpleHandlesForWorldHalos].
 
  self removeAllMorphs.  "remove old handles, if any"
 
  self bounds: target renderedMorph worldBoundsForHalo.  "update my size"
 
  self addHandleAt: (((aBox topLeft + aBox leftCenter) // 2) + self simpleFudgeOffset) color: Color paleBuff icon: 'Halo-MoreHandles'
  on: #mouseDown send: #addFullHandles to: self.
 
  aHandle := self addGraphicalHandle: #Rotate at: aBox bottomLeft on: #mouseDown send: #startRot:with: to: self.
  aHandle on: #mouseMove send: #doRot:with: to: self.
 
+ (target isFlexMorph and: [target renderedMorph ~~ target])
- target isFlexMorph
  ifTrue: [(self addGraphicalHandle: #Scale at: aBox bottomRight  on: #mouseDown send: #startScale:with: to: self)
  on: #mouseMove send: #doScale:with: to: self]
  ifFalse: [(self addGraphicalHandle: #Scale at: aBox bottomRight on: #mouseDown send: #startGrow:with: to: self)
  on: #mouseMove send: #doGrow:with: to: self].
 
  innerTarget wantsSimpleSketchMorphHandles ifTrue:
  [self addSimpleSketchMorphHandlesInBox: aBox].
 
  growingOrRotating := false.
  self layoutChanged.
  self changed.
  !

Item was changed:
  ----- Method: TransformationMorph>>extent: (in category 'geometry') -----
  extent: newExtent
+
+ self renderedMorph == self
+ ifTrue: [super extent: newExtent]
+ ifFalse: [
+ self adjustAfter: [
+ | scaleFactor |
+ scaleFactor := (self scale * newExtent r / self fullBounds extent r) max: 0.1.
+ self scale: (scaleFactor detentBy: 0.1 atMultiplesOf: 1.0 snap: false)]].!
-
- self adjustAfter:
- [ | scaleFactor |
- scaleFactor := (self scale * newExtent r / self fullBounds extent r) max: 0.1.
- self scale: (scaleFactor detentBy: 0.1 atMultiplesOf: 1.0 snap: false)]!

Item was added:
+ ----- Method: TransformationMorph>>initialize (in category 'initialization') -----
+ initialize
+
+ super initialize.
+
+ self
+ color: ((Color gray: 0.7) alpha: 0.5);
+ borderStyle: (DashedBorder color: (Color gray: 0.4) width: 1).!

Item was changed:
  ----- Method: TransformationMorph>>shouldDropOnMouseUp (in category 'dropping/grabbing') -----
  shouldDropOnMouseUp
+
+ ^ self renderedMorph in: [:target |
+ target == self
+ ifTrue: [super shouldDropOnMouseUp]
+ ifFalse: [target shouldDropOnMouseUp]]!
- "check if my submorph should drop "
- ^self firstSubmorph shouldDropOnMouseUp!

Item was added:
+ ----- Method: TransformationMorph>>wantsHaloFromClick (in category 'halos and balloon help') -----
+ wantsHaloFromClick
+
+ ^ self renderedMorph == self!


Reply | Threaded
Open this post in threaded view
|

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

Karl Ramberg
Nice.
Those TransformationMorphs that raise debuggers are really unfriendly.

Best.,
Karl

On Thu, Sep 26, 2019 at 11:26 AM <[hidden email]> wrote:
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.1544.mcz

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

Name: Morphic-mt.1544
Author: mt
Time: 26 September 2019, 11:26:14.016433 am
UUID: c3372aee-2104-9049-a6ef-4faa1f0eb079
Ancestors: Morphic-mt.1543

If you happen to end up with a TransformationMorph that has no children, you can now:

- open a halo on it to move/resize/delete it
- drag-and-drop it around in the world without a debugger nagging you

=============== Diff against Morphic-mt.1543 ===============

Item was changed:
  ----- Method: HaloMorph>>addScaleHandle: (in category 'handles') -----
  addScaleHandle: haloSpec
+       
+       (target isFlexMorph and: [target renderedMorph ~~ target])
+               ifTrue: [(self addHandle: haloSpec
+                                       on: #mouseDown send: #startScale:with: to: self)
+                                       on: #mouseMove send: #doScale:with: to: self]
+               ifFalse: [(self addHandle: haloSpec
+                                       on: #mouseDown send: #startGrow:with: to: self)
+                                       on: #mouseMove send: #doGrow:with: to: self].
-       target isFlexMorph ifTrue:
-               [(self addHandle: haloSpec
-                               on: #mouseDown send: #startScale:with: to: self)
-                               on: #mouseMove send: #doScale:with: to: self].
-       "This or addGrowHandle:, but not both, will prevail at any one time"
  !

Item was changed:
  ----- Method: HaloMorph>>addSimpleHandlesTo:box: (in category 'halos and balloon help') -----
  addSimpleHandlesTo: aHaloMorph box: aBox
        | aHandle |
        simpleMode := true.

        target isWorldMorph ifTrue: [^ self addSimpleHandlesForWorldHalos].

        self removeAllMorphs.  "remove old handles, if any"

        self bounds: target renderedMorph worldBoundsForHalo.  "update my size"

        self addHandleAt: (((aBox topLeft + aBox leftCenter) // 2) + self simpleFudgeOffset) color: Color paleBuff icon: 'Halo-MoreHandles'
                on: #mouseDown send: #addFullHandles to: self.

        aHandle := self addGraphicalHandle: #Rotate at: aBox bottomLeft on: #mouseDown send: #startRot:with: to: self.
        aHandle on: #mouseMove send: #doRot:with: to: self.

+       (target isFlexMorph and: [target renderedMorph ~~ target])
-       target isFlexMorph
                ifTrue: [(self addGraphicalHandle: #Scale at: aBox bottomRight  on: #mouseDown send: #startScale:with: to: self)
                                on: #mouseMove send: #doScale:with: to: self]
                ifFalse: [(self addGraphicalHandle: #Scale at: aBox bottomRight on: #mouseDown send: #startGrow:with: to: self)
                                on: #mouseMove send: #doGrow:with: to: self].

        innerTarget wantsSimpleSketchMorphHandles ifTrue:
                [self addSimpleSketchMorphHandlesInBox: aBox].

        growingOrRotating := false.
        self layoutChanged.
        self changed.
  !

Item was changed:
  ----- Method: TransformationMorph>>extent: (in category 'geometry') -----
  extent: newExtent
+
+       self renderedMorph == self
+               ifTrue: [super extent: newExtent]
+               ifFalse: [
+                       self adjustAfter: [
+                               | scaleFactor |
+                               scaleFactor := (self scale * newExtent r / self fullBounds extent r) max: 0.1.
+                               self scale: (scaleFactor detentBy: 0.1 atMultiplesOf: 1.0 snap: false)]].!
-       
-       self adjustAfter:
-               [ | scaleFactor |
-               scaleFactor := (self scale * newExtent r / self fullBounds extent r) max: 0.1.
-               self scale: (scaleFactor detentBy: 0.1 atMultiplesOf: 1.0 snap: false)]!

Item was added:
+ ----- Method: TransformationMorph>>initialize (in category 'initialization') -----
+ initialize
+
+       super initialize.
+       
+       self
+               color: ((Color gray: 0.7) alpha: 0.5);
+               borderStyle: (DashedBorder color: (Color gray: 0.4) width: 1).!

Item was changed:
  ----- Method: TransformationMorph>>shouldDropOnMouseUp (in category 'dropping/grabbing') -----
  shouldDropOnMouseUp
+       
+       ^ self renderedMorph in: [:target |
+               target == self
+                       ifTrue: [super shouldDropOnMouseUp]
+                       ifFalse: [target shouldDropOnMouseUp]]!
-       "check if my submorph should drop "
-       ^self firstSubmorph shouldDropOnMouseUp!

Item was added:
+ ----- Method: TransformationMorph>>wantsHaloFromClick (in category 'halos and balloon help') -----
+ wantsHaloFromClick
+
+       ^ self renderedMorph == self!