Skip to content

Commit

Permalink
Fixed the following tests: testMovingLineStoppedAtEndMargin, testMovi…
Browse files Browse the repository at this point in the history
…ngLineInRightPosition, testHeightOfTimeline.

Therefore changed the minimumExtent of the timeline. This change explains the other changes in the tests: testDistanceBetweenKeyframes and testAddKeyframeToRightPosition
  • Loading branch information
Noel Bastubbe committed Aug 1, 2022
1 parent 75c7280 commit 43b00a8
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"buildInformationBarWith:" : "DM 8/4/2020 16:12",
"buildLoadJsonButtonWith:" : "FH 8/1/2021 18:37",
"buildLoadingMainWindow:" : "SG 5/21/2022 13:24",
"buildMainWindowWith:" : "SG 5/21/2022 14:11",
"buildMainWindowWith:" : "Noel Bastubbe 8/1/2022 10:59",
"buildPlayButtonWith:" : "FH 8/1/2021 18:39",
"buildPositionUIPanelWith:" : "FH 8/1/2021 18:39",
"buildPropertiesTreeWith:" : "ob 7/12/2022 18:57",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
accessing
animationDuration
^ self timeline endTime - self timeline startTime.
^ self timeline endTime max: self timeline minimumExtent
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"class" : {
"on:withExtent:" : "NR 7/18/2022 11:25" },
"instance" : {
"animationDuration" : "ob 6/9/2022 21:31",
"animationDuration" : "Noel Bastubbe 8/1/2022 10:36",
"initialize" : "NR 7/18/2022 11:26",
"lineWidth" : "ob 6/9/2022 20:18",
"playMovingAnimation" : "NR 7/18/2022 11:34" } }
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
constants
minimumExtent

^ 1000.
^ self animationsEditor informationBar width - self startMargin - self endMargin - (self animationsEditor informationBar borderWidth * 2).
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ updateStartEndProperty
| startEndProperty |

startEndProperty := self animationsEditor propertyStartEnd.
startEndProperty property: self property. "<--- Ich vermute, dass diese Zeile nicht ausgeführt wird und dadurch den Defekt erzeugt."
startEndProperty property: self property.
self property subproperties
do:[:subproperty | subproperty addDependent: startEndProperty].

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"initialExtent" : "MH 8/1/2021 18:57",
"initialize" : "NR 7/18/2022 11:31",
"initializeStartEndTime" : "mjs 7/31/2021 17:38",
"minimumExtent" : "NR 7/18/2022 10:43",
"minimumExtent" : "Noel Bastubbe 8/1/2022 11:55",
"movingLine" : "SG 5/21/2022 15:38",
"movingLine:" : "SG 5/21/2022 15:38",
"property" : "MH 8/1/2021 18:57",
Expand All @@ -31,4 +31,4 @@
"trackHeight" : "MH 8/1/2021 18:57",
"update:" : "SG 5/23/2022 18:40",
"updateExtent" : "NR 7/18/2022 10:41",
"updateStartEndProperty" : "6/17/2022 14:09:28" } }
"updateStartEndProperty" : "Noel Bastubbe 8/1/2022 10:56" } }
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
constants
middleOfAnimationTime

^ (self endFrame max: 1000) / 2.
^ (self timeline minimumExtent / 2) truncated.
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
testing
testAddKeyframeToRightPosition
| keyframeCenter keyframeBar keyframeBarPosition addedKeyframeMorph |

keyframeBar := (self positionTrack submorphs at: 2).

keyframeBarPosition := keyframeBar position.
| keyframeCenter middleOfKeyframeBar keyframeBarPosition addedKeyframeMorph |

keyframeBarPosition := self positionTrack position.
middleOfKeyframeBar := keyframeBarPosition + (self middleOfAnimationTime @ (self positionTrack height / 2)) + (self timeline startMargin @ 0).
self createKeyframeWith: self animationPosition on: self middleOfAnimationTime.

addedKeyframeMorph := self positionTrack submorphs first.
keyframeCenter := addedKeyframeMorph center.
self assert: ((keyframeBar width / 2) @ (keyframeBar height / 2) + keyframeBarPosition) truncated = keyframeCenter.
self assert: middleOfKeyframeBar truncated = keyframeCenter.
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
testing
testDistanceBetweenKeyframes
| frameDistance distanceBetweenKeyframes startKeyframeMorph addedKeyframeMorph keyframeBar |
| frameDistance distanceBetweenKeyframes startKeyframeMorph addedKeyframeMorph |

self createKeyframeWith: self animationPosition on: self frameNumber1000.
keyframeBar := (self positionTrack submorphs at: (self secondLastOn: self positionTrack)).
frameDistance := self frameNumber1000 - self startFrame.
addedKeyframeMorph := self positionTrack submorphs first.
startKeyframeMorph := self positionTrack submorphs second.
distanceBetweenKeyframes := addedKeyframeMorph bounds origin - startKeyframeMorph bounds origin.

self assert: (keyframeBar width - self paddingDistance) // (self endFrame / frameDistance) = distanceBetweenKeyframes x.
self assert: frameDistance = distanceBetweenKeyframes x.
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
testing
testHeightOfTimeline
"| oldHeight scrollBarThickness offScreenFrame |
| 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."
"self expected: self failure."

self assert: true.
self assert: oldHeight - scrollBarThickness = self timeline height.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
testing
testMovingLineInRightPosition
"

self timeline createMovingLine.
self movingLine: self timeline movingLine.
self
Expand All @@ -10,8 +10,7 @@ testMovingLineInRightPosition
wait: 250;
assert: (self movingLine position x rounded between: (self movingLine startMargin + 499) and: (self movingLine startMargin + 501));
wait: 250;
assert: (self movingLine position x rounded between: (self movingLine startMargin + 749) and: (self movingLine startMargin + 751))."
self assert: true.
assert: (self movingLine position x rounded between: (self movingLine startMargin + 749) and: (self movingLine startMargin + 751)).



Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
testing
testMovingLineStoppedAtEndMargin
"self timeline createMovingLine.

self timeline createMovingLine.
self movingLine: self timeline movingLine.
self
wait: 1500;
should: self movingLine position x = (self movingLine startMargin + 1000)."
self assert: true.
should: self movingLine position x = (self movingLine startMargin + self timeline minimumExtent).
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"inaccuracyFactor" : "ob 6/9/2022 20:56",
"keyframeHeightOn:" : "NB 8/1/2021 14:07",
"keyframeWidthOn:" : "NB 8/1/2021 14:07",
"middleOfAnimationTime" : "NR 7/18/2022 11:10",
"middleOfAnimationTime" : "Noel Bastubbe 8/1/2022 11:21",
"moveMovingLine:" : "NR 7/18/2022 11:08",
"movingLine" : "ob 5/27/2022 16:57",
"movingLine:" : "ob 5/27/2022 16:57",
Expand All @@ -29,14 +29,14 @@
"startFrame" : "MH 8/1/2021 18:42",
"startMargin" : "ob 5/29/2022 17:46",
"tearDown" : "SG 6/22/2022 14:15",
"testAddKeyframeToRightPosition" : "Noel Bastubbe 6/13/2022 19:27",
"testDistanceBetweenKeyframes" : "NR 7/18/2022 11:14",
"testAddKeyframeToRightPosition" : "Noel Bastubbe 8/1/2022 11:47",
"testDistanceBetweenKeyframes" : "Noel Bastubbe 8/1/2022 11:52",
"testDurationDisplay" : "7/1/2022 15:59:00",
"testHeightOfTimeline" : "NR 7/18/2022 18:29",
"testHeightOfTimeline" : "Noel Bastubbe 8/1/2022 11:00",
"testMinWidthOfTimeline" : "NR 7/18/2022 11:12",
"testMovingLineInRightPosition" : "NR 7/18/2022 11:50",
"testMovingLineInRightPosition" : "Noel Bastubbe 8/1/2022 10:24",
"testMovingLineInitializedInRightPosition" : "NR 7/18/2022 11:40",
"testMovingLineStoppedAtEndMargin" : "NR 7/18/2022 11:51",
"testMovingLineStoppedAtEndMargin" : "Noel Bastubbe 8/1/2022 11:12",
"testWidthOfTimeline" : "NR 7/18/2022 11:11",
"testZeroDurationAtStart" : "ob 7/30/2022 17:38",
"timebar" : "ob 7/30/2022 17:35",
Expand Down

0 comments on commit 43b00a8

Please sign in to comment.