[squeak-dev] The Trunk: EToys-mt.491.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Jan 23 16:17:42 UTC 2023


Marcel Taeumel uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-mt.491.mcz

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

Name: EToys-mt.491
Author: mt
Time: 23 January 2023, 5:17:39.932818 pm
UUID: f06418bf-35d8-dc4a-af6b-abd9703ceddb
Ancestors: EToys-tpr.490

Complement Morphic-mt.2071

=============== Diff against EToys-tpr.490 ===============

Item was changed:
  ----- Method: EventRecordingSpaceNavigator>>doNewPainting (in category 'the actions') -----
  doNewPainting
  	"Make a new painting"
  
  	| worldlet |
  	self currentWorld assureNotPaintingElse: [^ self].
  	worldlet := self ownerThatIsA: Worldlet.
  	worldlet closeNavigatorFlap.
+ 	worldlet makeNewDrawing: (self currentEvent translatedTo: worldlet center).!
- 	worldlet makeNewDrawing: (self currentEvent copy setPosition: worldlet center).!

Item was changed:
  ----- Method: InteriorSugarNavBar>>doNewPainting (in category 'buttons') -----
  doNewPainting
  	"Make a new painting"
  
  	| worldlet aRect |
  	self currentWorld assureNotPaintingElse: [^ self].
  	worldlet := self ownerThatIsA: Worldlet.
  	aRect := (worldlet topLeft + (0 @ self height)) corner: worldlet bottomRight.
+ 	worldlet makeNewDrawing: (self currentEvent translatedTo: aRect center).!
- 	worldlet makeNewDrawing: (self currentEvent copy setPosition: aRect center).!

Item was removed:
- ----- Method: KeyboardEvent>>keyValue: (in category '*Etoys-Squeakland-initialize') -----
- keyValue: aValue
- 	"Directly set the keyValue.  Used by event-recording mechanisms."
- 
- 	keyValue := aValue!

Item was changed:
  ----- Method: KeyboardEventMorph>>changeCharacter (in category 'menu commands') -----
  changeCharacter
  	"Allow the user to select a new character for the receiver."
  
  	| result |
  	result := FillInTheBlank request: 'New character? ' translated initialAnswer: character asString.
  	result isEmptyOrNil ifTrue: [^ self].
  	result = character asString ifTrue: [^ self].
+ 	event setKeyValue: result first asciiValue.
- 	event keyValue: result first asciiValue.
  	self eventRoll ifNotNil: [:r | r pushChangesBackToEventTheatre]!

Item was changed:
  ----- Method: MentoringEventRecorder>>nextEventToPlay (in category 'event handling') -----
  nextEventToPlay
  	"Return the next event when it is time to be replayed.
  	If it is not yet time, then return an interpolated mouseMove.
  	Return nil if nothing has happened.
  	Return an EOF event if there are no more events to be played."
  
  	| nextEvent now nextTime lastP delta |
  	(tapeStream isNil or:[tapeStream atEnd]) 
  		ifTrue:[^MorphicUnknownEvent new setType: #EOF argument: nil].
  	now := Time millisecondClockValue.
  	nextEvent := tapeStream next shallowCopy.	"always copied"
  	areaOffset ifNotNil: [nextEvent isMouse ifTrue: 
+ 		[nextEvent translateBy: areaOffset]]. 
+ 	nextEvent isKeyboard ifTrue: [ nextEvent translateTo: areaBounds center].
- 		[nextEvent position: nextEvent position + areaOffset]]. 
- 	nextEvent isKeyboard ifTrue: [ nextEvent setPosition: areaBounds center].
  	nextEvent type == #noCondense ifTrue: [^nil].	"ignore in playback"
  	deltaTime ifNil:[deltaTime := now - nextEvent timeStamp].
  	nextTime := nextEvent timeStamp + deltaTime.
  	now < time ifTrue:["clock rollover"
  		time := now.
  		deltaTime := nil.
  		^nil "continue it on next cycle"].
  	time := now.
  	(now >= nextTime) ifTrue:[
  		nextEvent setTimeStamp: nextTime.
  		nextEvent isMouse ifTrue:[lastEvent := nextEvent] ifFalse:[lastEvent := nil].
  		^nextEvent].
  	tapeStream skip: -1.
  	"Not time for the next event yet, but interpolate the mouse.
  	This allows tapes to be compressed when velocity is fairly constant."
  	lastEvent ifNil: [^ nil].
  	now - lastInterpolation < 20 "WorldState minCycleLapse" ifTrue: [^ nil].
  	lastP := lastEvent position.
  	delta := (nextEvent position - lastP) * (now - lastEvent timeStamp) // (nextTime - lastEvent timeStamp).
  	(delta dist: lastDelta) < 3 ifTrue: [^ nil]. "Almost no movement"
  	lastDelta := delta.
  	lastInterpolation := now.
  	^ MouseMoveEvent new
  		setType: #mouseMove 
  		startPoint: lastEvent position endPoint: lastP + delta
  		trail: nil buttons: lastEvent buttons hand: nil stamp: now.!

Item was removed:
- ----- Method: MorphicEvent>>position: (in category '*Etoys-Squeakland-accessing') -----
- position: aPoint
- 	"Set my position, if it makes sense for me."!

Item was removed:
- ----- Method: MorphicEvent>>translateBy: (in category '*Etoys-Squeakland-transforming') -----
- translateBy: delta
- 	"Reposition the receiver by delta.  For non-UI events, this is meaningless"!

Item was changed:
  ----- Method: SugarNavigatorBar>>doNewPainting (in category 'button actions') -----
  doNewPainting
  	
  	| w |
  
  	w := self world.
  	w assureNotPaintingElse: [^ self].
+ 	w makeNewDrawing: (self primaryHand lastEvent translatedTo: w center)
- 	w makeNewDrawing: (self primaryHand lastEvent copy setPosition: w center)
  !

Item was removed:
- ----- Method: UserInputEvent>>position: (in category '*Etoys-Squeakland-accessing') -----
- position: aPoint
- 	"normally immutable, except in event recorder"
- 	position := aPoint!



More information about the Squeak-dev mailing list