Skip to content

Commit

Permalink
Merge branch 'dev' into duration
Browse files Browse the repository at this point in the history
  • Loading branch information
Noel-Bastubbe committed Jun 14, 2022
2 parents ba41478 + fb6b047 commit cc29716
Show file tree
Hide file tree
Showing 39 changed files with 171 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"resetTargetMorph" : "FH 8/1/2021 18:48",
"saveAnimations" : "FH 8/1/2021 18:48",
"savedAnimationText" : "mjs 7/31/2021 15:08",
"seedProperties" : "FH 8/1/2021 18:49",
"seedProperties" : "Noel Bastubbe 6/14/2022 15:28",
"selectMorphByHand" : "FH 8/1/2021 18:49",
"selectedTreeNode" : "JIZ 5/27/2020 15:31",
"selectedTreeNode:" : "FH 8/1/2021 18:27",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
updating
findLastKey
| last |

last:= self endTime.
self property subproperties do:[:subproperty | subproperty targetValues keysDo: [:key | key > last ifTrue:[last:= key]]].
^last


Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
property: anObject
property := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
property
^ property
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
updating
update: aSymbol
aSymbol = #addKeyframes
ifTrue:[self endTime < self findLastKey ifTrue:[self endTime: self findLastKey]].


Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@
"endTime" : "FH 8/1/2021 19:29",
"endTime:" : "FH 8/1/2021 19:29",
"endTimeAsString" : "FH 8/1/2021 19:29",
"initialize" : "mjs 7/31/2021 17:24",
"findLastKey" : "lka 5/30/2022 11:27",
"initialize" : "lka 5/30/2022 11:44",
"isStartEnd" : "mjs 7/31/2021 17:19",
"property" : "lka 5/27/2022 11:52",
"property:" : "lka 5/27/2022 11:52",
"startTime" : "FH 8/1/2021 19:29",
"startTime:" : "FH 8/1/2021 19:29",
"startTimeAsString" : "FH 8/1/2021 19:30" } }
"startTimeAsString" : "FH 8/1/2021 19:30",
"update:" : "lka 5/27/2022 12:25" } }
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"commentStamp" : "tk 8/7/2020 17:54",
"instvars" : [
"endTime",
"startTime" ],
"startTime",
"property" ],
"name" : "AnimationsEditorPropertyStartEnd",
"pools" : [
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
updating
addIntermediateLines
| positionX intermediateStart intermediateEnd lineRepetition |

intermediateStart := self timeline startTime + 1.
intermediateEnd := self timeline endTime - 1.
lineRepetition := 100.
intermediateStart to: intermediateEnd
do: [:frame | frame \\ lineRepetition = 0
ifTrue: [
positionX := self convertFrameToPosition: frame.
self addLineFrom: positionX @ self height to: positionX @ (self height - self lineHeight)]].
| positionX frame |
frame := self timeline startTime + self intermediateLineDistance.
[self timeline endTime > frame]
whileTrue: [positionX := self convertFrameToPosition: frame.
self addLineFrom: positionX @ self height to: positionX @ (self height - self lineHeight).
self addLineLabelFor: (frame asString) to: (positionX - self labelXOffset) @ (self height - self lineHeight - self labelYOffset).
frame := frame + self intermediateLineDistance.].
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
updating
addLineLabelFor: aFrame to: aPosition
| label |

label := StringMorph new.
label contents: aFrame.
label position: aPosition.
label fontName: 'default' size: 13.
self addMorph: label.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
constants
intermediateLineDistance
^100.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
constants
labelXOffset

^ 10
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
constants
labelYOffset

^ 10
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"on:withExtent:" : "FH 8/1/2021 19:32" },
"instance" : {
"addEndLine" : "MH 8/1/2021 19:30",
"addIntermediateLines" : "MH 8/1/2021 19:21",
"addIntermediateLines" : "Noel Bastubbe 6/14/2022 15:23",
"addLineFrom:to:" : "MH 8/1/2021 19:22",
"addMovingLine" : "SG 5/23/2022 17:59",
"addStartEndLine" : "MH 8/1/2021 19:24",
Expand All @@ -25,3 +25,4 @@
"step" : "SG 5/23/2022 18:41",
"stepTime" : "SG 5/23/2022 18:02",
"updateScale" : "SG 5/23/2022 18:41" } }

Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ initialize
self
extent: self initialExtent;
color: Color lightGray;
initializeStartEndTime;
setDefaultProperty.
setDefaultProperty;
initializeStartEndTime.
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ Transcript show: self endTime.
self updateExtent.
self property: aProperty.
self createTracks.
self addTimebar.
self addTimebar.
self updateStartEndProperty.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
updating
update: aStartEndProperty
self updateExtent.
self startTime: aStartEndProperty startTime.
self endTime: aStartEndProperty endTime.
self endTime: aStartEndProperty endTime.
self updateExtent.
self createTracks.
Transcript show: 'update'.
self addTimebar.
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
updating
updateExtent
self extent: self scrollPane extent - (self borderWidth * 2).
| normalHeight fullWidth |

normalHeight := self scrollPane height - self borderWidth.
fullWidth := self endTime + self startMargin + self endMargin.
self width: fullWidth.
fullWidth > self scrollPane width
ifTrue: [self height: normalHeight - self scrollPane scrollBarThickness.]
ifFalse: [self height: normalHeight.].

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
updating
updateStartEndProperty
| startEndProperty |

startEndProperty := self animationsEditor propertyStartEnd.
startEndProperty property: self property. "<--- Ich vermute, dass diese Zeile nicht ausgeführt wird und dadurch den Defekt erzeugt."
self property subproperties
do:[:subproperty | subproperty addDependent: startEndProperty].
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
"name" : "AnimationsEditorTimeline",
"pools" : [
],
"super" : "RectangleMorph",
"super" : "AnimationsEditorTimelineObject",
"type" : "normal" }
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
creation
convertFrameToPosition: aFrame
| position totalDuration framesPerPixel frameOffset |

totalDuration := self timeline endTime - self timeline startTime.
framesPerPixel := totalDuration / self lineSegmentWidth.
frameOffset := aFrame / framesPerPixel.
position := self startMargin + frameOffset.
^ position.
^self startMargin + aFrame.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"class" : {
},
"instance" : {
"convertFrameToPosition:" : "MH 8/1/2021 19:19",
"convertFrameToPosition:" : "Noel Bastubbe 6/9/2022 17:42",
"endMargin" : "MH 8/1/2021 18:59",
"lineSegmentWidth" : "MH 8/1/2021 18:59",
"startMargin" : "MH 8/1/2021 18:59",
"startMargin" : "Noel Bastubbe 6/9/2022 17:45",
"timeline" : "MH 8/1/2021 19:00",
"timeline:" : "MH 8/1/2021 18:48" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
animationsEditorInstance: anObject
animationsEditorInstance := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
animationsEditorInstance
^ animationsEditorInstance
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
morph: anObject
morph := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
morph
^ morph
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
property: anObject
property := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
accessing
property
^ property
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
running
setUp
super setUp.
self propertyStartEnd: AnimationsEditorPropertyStartEnd new.
self animationsEditorInstance: AnimationsEditor open.
self propertyStartEnd: self animationsEditorInstance propertyStartEnd.
self morph: Morph new openInWorld.
self animationsEditorInstance addTargetMorph: self morph.
self property: self animationsEditorInstance propertyList second.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
running
tearDown
self morph isFlexed
ifTrue: [self morph owner abandon].
self morph abandon.
self animationsEditorInstance windowReference abandon.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
testing
testAddKeyframeAfterEndtime
| positionProperty oldEndtime propertyStartEnd newEndtime|

positionProperty := self property subproperties at: 'position'.
propertyStartEnd := self animationsEditorInstance propertyStartEnd.
self animationsEditorInstance selectedTreeNode: positionProperty.
oldEndtime := propertyStartEnd endTime.
positionProperty
positionX: 555;
positionY: 555;
frame: oldEndtime + 1;
addKeyframe.
newEndtime := propertyStartEnd endTime.
self assert: oldEndtime + 1 =newEndtime.



Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
"class" : {
},
"instance" : {
"animationsEditorInstance" : "lka 5/30/2022 10:38",
"animationsEditorInstance:" : "lka 5/30/2022 10:38",
"morph" : "lka 5/30/2022 10:38",
"morph:" : "lka 5/30/2022 10:38",
"property" : "lka 5/30/2022 10:38",
"property:" : "lka 5/30/2022 10:38",
"propertyStartEnd" : "MH 8/1/2021 18:35",
"propertyStartEnd:" : "MH 8/1/2021 18:35",
"setUp" : "MH 7/8/2021 12:08",
"setUp" : "lka 5/30/2022 11:43",
"tearDown" : "lka 5/30/2022 10:39",
"testAddKeyframeAfterEndtime" : "Noel Bastubbe 6/9/2022 17:48",
"testInstanceCreation" : "LW 6/27/2021 13:09" } }
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
],
"commentStamp" : "",
"instvars" : [
"propertyStartEnd" ],
"propertyStartEnd",
"animationsEditorInstance",
"morph",
"property" ],
"name" : "AnimationsEditorPropertyStartEndTest",
"pools" : [
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ testOnlyPlaysAnimationInsideStartEndTime
positionProperty
positionX: 555;
positionY: 555;
frame: (propertyStartEnd endTime)*2; "out of bounds"
frame: (propertyStartEnd startTime) - 1; "out of bounds"
addKeyframe.
animations := positionProperty createAnimationSequenceWithStartEnd: propertyStartEnd.
self assert: animations size = 2.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ testShowMessageKeyframeOutOfBounds
propertyStartEnd := self animationsEditorInstance propertyStartEnd.
positionProperty positionX: 555;
positionY: 555;
frame: propertyStartEnd endTime + 1000; "out of bounds"
frame: propertyStartEnd startTime - 1; "out of bounds"
addKeyframe.
positionProperty createAnimationSequenceWithStartEnd: propertyStartEnd.
self assert: self animationsEditorInstance informationBarText = positionProperty messageKeyframeOutOfBounds.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"testHasSubProperties" : "MH 8/1/2021 18:37",
"testInstanceCreation" : "DM 8/4/2020 13:47",
"testMessageNotEnoughKeyframes" : "MH 8/1/2021 18:38",
"testOnlyPlaysAnimationInsideStartEndTime" : "MH 8/1/2021 18:38",
"testOnlyPlaysAnimationInsideStartEndTime" : "Noel Bastubbe 6/13/2022 18:01",
"testPlayAnimationWithStartEnd" : "MH 8/1/2021 18:38",
"testShowMessageKeyframeOutOfBounds" : "MH 8/1/2021 18:38",
"testShowMessageKeyframeOutOfBounds" : "Noel Bastubbe 6/13/2022 18:05",
"testShowMessageSelectAnimatedProperty" : "CL 8/2/2021 09:05",
"testTargetValuesIsSorted" : "MH 8/1/2021 18:38" } }
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ testAddKeyframeToRightPosition
| keyframeCenter keyframeBar keyframeBarPosition addedKeyframeMorph |

keyframeBar := (self positionTrack submorphs at: (self secondLastOn: self positionTrack)).
keyframeBarPosition := keyframeBar bounds origin x @ keyframeBar bounds origin y.
keyframeBarPosition := keyframeBar position.

self createKeyframeWith: self animationPosition on: self middleOfAnimationTime.

addedKeyframeMorph := self positionTrack submorphs first.
keyframeCenter := self calculateKeyframeCenterOn: addedKeyframeMorph.
keyframeCenter := addedKeyframeMorph center.

self assert: (keyframeBar width / 2) @ (keyframeBar height / 2) + keyframeBarPosition = keyframeCenter.
self assert: ((keyframeBar width / 2) @ (keyframeBar height / 2) + keyframeBarPosition) truncated = keyframeCenter.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
testing
testHeightOfTimeline
| oldHeight scrollBarThickness offScreenFrame |

offScreenFrame := self animationsEditorInstance mainWindow width.
self animationsEditorInstance propertyStartEnd endTime: 0.
oldHeight := self timeline height.
self createKeyframeWith: self animationPosition on: offScreenFrame.
scrollBarThickness := self timeline scrollPane scrollBarThickness.
self assert: oldHeight - scrollBarThickness = self timeline height.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
testing
testWidthOfTimeline
| oldWidth |

oldWidth := self timeline width.
self createKeyframeWith: self animationPosition on: self endFrame + 2000.
self assert: oldWidth + 2000 = self timeline width.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"startFrame" : "MH 8/1/2021 18:42",
"startMargin" : "ob 5/29/2022 17:46",
"tearDown" : "NB 8/1/2021 12:38",
"testAddKeyframeToRightPosition" : "NB 8/1/2021 15:22",
"testAddKeyframeToRightPosition" : "Noel Bastubbe 6/13/2022 19:27",
"testDistanceBetweenKeyframes" : "mjs 8/1/2021 16:45",
"testMovingLineInRightPosition" : "ob 5/29/2022 17:40",
"testMovingLineInitializedInRightPosition" : "ob 5/29/2022 17:34",
Expand Down

0 comments on commit cc29716

Please sign in to comment.