Skip to content

Commit

Permalink
Timeline length is now dependend on the duration of the animation
Browse files Browse the repository at this point in the history
  • Loading branch information
Noel Bastubee committed Jun 9, 2022
1 parent a4cedb5 commit a20d07e
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
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).
frame := frame + self intermediateLineDistance.].
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
Expand Up @@ -3,11 +3,12 @@
"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/9/2022 17:32",
"addLineFrom:to:" : "MH 8/1/2021 19:22",
"addStartEndLine" : "MH 8/1/2021 19:24",
"addStartLine" : "MH 8/1/2021 19:28",
"initialize" : "MH 8/1/2021 19:00",
"intermediateLineDistance" : "Noel Bastubbe 6/9/2022 17:21",
"lineHeight" : "MH 8/1/2021 19:00",
"lineWidth" : "MH 8/1/2021 19:22",
"startEndLineHeight" : "MH 8/1/2021 19:00",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
updating
update: aStartEndProperty
self updateExtent.
self startTime: aStartEndProperty startTime.
self endTime: aStartEndProperty endTime.
self endTime: aStartEndProperty endTime.
self updateExtent.
self createTracks.
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
@@ -1,8 +1,8 @@
updating
updateStartEndProperty
| startEndProperty |
| startEndProperty |

startEndProperty := self animationsEditor propertyStartEnd.
startEndProperty property: self property.
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 @@ -23,6 +23,6 @@
"timebar" : "MH 8/1/2021 18:57",
"timebar:" : "MH 8/1/2021 18:57",
"trackHeight" : "MH 8/1/2021 18:57",
"update:" : "CL 8/2/2021 08:51",
"updateExtent" : "MH 8/1/2021 18:58",
"updateStartEndProperty" : "lka 5/27/2022 12:33" } }
"update:" : "Noel Bastubbe 6/9/2022 14:04",
"updateExtent" : "Noel Bastubbe 6/9/2022 17:29",
"updateStartEndProperty" : "Noel Bastubbe 6/9/2022 16:00" } }
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,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
Expand Up @@ -4,6 +4,7 @@ testAddKeyframeAfterEndtime

positionProperty := self property subproperties at: 'position'.
propertyStartEnd := self animationsEditorInstance propertyStartEnd.
self animationsEditorInstance selectedTreeNode: positionProperty.
oldEndtime := propertyStartEnd endTime.
positionProperty
positionX: 555;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"propertyStartEnd:" : "MH 8/1/2021 18:35",
"setUp" : "lka 5/30/2022 11:43",
"tearDown" : "lka 5/30/2022 10:39",
"testAddKeyframeAfterEndtime" : "lka 5/30/2022 11:55",
"testAddKeyframeAfterEndtime" : "Noel Bastubbe 6/9/2022 17:48",
"testInstanceCreation" : "LW 6/27/2021 13:09" } }

0 comments on commit a20d07e

Please sign in to comment.