From f43509c132b5302b9983667aaf99251051b38b59 Mon Sep 17 00:00:00 2001 From: andrewdkim Date: Wed, 14 Aug 2019 11:52:33 -0400 Subject: bug fix with currentBarX --- src/client/views/animationtimeline/Keyframe.tsx | 4 ++-- src/client/views/animationtimeline/Timeline.tsx | 8 ++++---- src/client/views/animationtimeline/Track.tsx | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/client/views/animationtimeline/Keyframe.tsx b/src/client/views/animationtimeline/Keyframe.tsx index f6c04d43e..6a0525eb8 100644 --- a/src/client/views/animationtimeline/Keyframe.tsx +++ b/src/client/views/animationtimeline/Keyframe.tsx @@ -183,8 +183,8 @@ export class Keyframe extends React.Component { let finish = await this.makeKeyData(this.regiondata.position + this.regiondata.duration, KeyframeFunc.KeyframeType.fade)!; (fadeIn.key! as Doc).opacity = 1; (fadeOut.key! as Doc).opacity = 1; - (start.key! as Doc).opacity = 0.1; - (finish.key! as Doc).opacity = 0.1; + (start.key! as Doc).opacity = 0; + (finish.key! as Doc).opacity = 0; observe(this.regiondata, change => { if (change.type === "update") { diff --git a/src/client/views/animationtimeline/Timeline.tsx b/src/client/views/animationtimeline/Timeline.tsx index a29758694..29787fa03 100644 --- a/src/client/views/animationtimeline/Timeline.tsx +++ b/src/client/views/animationtimeline/Timeline.tsx @@ -125,7 +125,7 @@ export class Timeline extends CollectionSubView(Document) { @action changeCurrentBarX = (pixel: number) => { - this._currentBarX = pixel; + pixel <= 0 ? this._currentBarX = 0 : pixel >= this._totalLength ? this._currentBarX = this._totalLength : this._currentBarX = pixel; } //for playing @@ -184,7 +184,7 @@ export class Timeline extends CollectionSubView(Document) { let scrubberbox = this._scrubberbox.current!; let left = scrubberbox.getBoundingClientRect().left; let offsetX = Math.round(e.clientX - left) * this.props.ScreenToLocalTransform().Scale; - this._currentBarX = offsetX; + this.changeCurrentBarX(offsetX); } @action @@ -192,8 +192,8 @@ export class Timeline extends CollectionSubView(Document) { e.preventDefault(); e.stopPropagation(); let scrubberbox = this._scrubberbox.current!; - let offset = (e.clientX - scrubberbox.getBoundingClientRect().left) * this.props.ScreenToLocalTransform().Scale; - this._currentBarX = offset; + let offsetX = (e.clientX - scrubberbox.getBoundingClientRect().left) * this.props.ScreenToLocalTransform().Scale; + this.changeCurrentBarX(offsetX); } diff --git a/src/client/views/animationtimeline/Track.tsx b/src/client/views/animationtimeline/Track.tsx index 6bdabeb93..288a1d2ad 100644 --- a/src/client/views/animationtimeline/Track.tsx +++ b/src/client/views/animationtimeline/Track.tsx @@ -94,8 +94,8 @@ export class Track extends React.Component { this.props.node.hidden = false; await this.timeChange(this.props.currentBarX); } else { - console.log("heuulloo"); - this.props.node.hidden = true; + this.props.node.hidden = true; + this.props.node.opacity = 0; } }, { fireImmediately: true }); } -- cgit v1.2.3-70-g09d2