Browse Source

resolving comments

Alejandro Toledo 5 years ago
parent
commit
0f6a25ac32

+ 3 - 3
inspector/src/components/actionTabs/tabs/propertyGrids/animations/animationCurveEditorComponent.tsx

@@ -214,7 +214,7 @@ export class AnimationCurveEditorComponent extends React.Component<
     }
 
     let valueLines = Math.round((this.state.scale * this._heightScale) / 10);
-    console.log(length);
+
     let newFrameLength = new Array(length).fill(0).map((s, i) => {
       return { value: i * 10, label: i };
     });
@@ -1391,7 +1391,7 @@ export class AnimationCurveEditorComponent extends React.Component<
     }
   }
 
-  getCurrentFrame(frame: number) {
+  isCurrentFrame(frame: number) {
     if (this.state.currentFrame === frame) {
       return true;
     } else {
@@ -1534,7 +1534,7 @@ export class AnimationCurveEditorComponent extends React.Component<
                       </text>
                       <line x1={f.value} y1='0' x2={f.value} y2='5%'></line>
 
-                      {this.getCurrentFrame(f.label) ? (
+                      {this.isCurrentFrame(f.label) ? (
                         <svg>
                           <line
                             x1={f.value}

+ 1 - 1
inspector/src/components/actionTabs/tabs/propertyGrids/animations/graphActionsBar.tsx

@@ -56,7 +56,7 @@ export class GraphActionsBar extends React.Component<IGraphActionsBarProps> {
             onClick={this.props.addKeyframe}
           />
           <IconButtonLineComponent
-            tooltip={'Frame'}
+            tooltip={'Frame selected keyframes'}
             icon='frame'
             onClick={this.props.removeKeyframe}
           />

+ 8 - 11
inspector/src/components/actionTabs/tabs/propertyGrids/animations/timeline.tsx

@@ -33,6 +33,7 @@ export class Timeline extends React.Component<
   private _direction: number;
   private _scrolling: boolean;
   private _shiftX: number;
+  private _active: string = '';
 
   constructor(props: ITimelineProps) {
     super(props);
@@ -246,8 +247,6 @@ export class Timeline extends React.Component<
     this.setState({ activeKeyframe: null });
   }
 
-  private active: string = '';
-
   scrollDragStart(e: React.TouchEvent<HTMLDivElement>): void;
   scrollDragStart(e: React.MouseEvent<HTMLDivElement, MouseEvent>): void;
   scrollDragStart(e: any) {
@@ -264,21 +263,19 @@ export class Timeline extends React.Component<
     }
 
     if (
-      (e.target.className === 'left-grabber' ||
-        e.target.className === 'left-draggable') &&
+      e.target.className === 'left-grabber' &&
       this._scrollbarHandle.current
     ) {
-      this.active = 'leftDraggable';
+      this._active = 'leftDraggable';
       this._shiftX =
         e.clientX - this._scrollbarHandle.current.getBoundingClientRect().left;
     }
 
     if (
-      (e.target.className === 'right-grabber' ||
-        e.target.className === 'right-draggable') &&
+      e.target.className === 'right-grabber' &&
       this._scrollbarHandle.current
     ) {
-      this.active = 'rightDraggable';
+      this._active = 'rightDraggable';
       this._shiftX =
         e.clientX - this._scrollbarHandle.current.getBoundingClientRect().left;
     }
@@ -323,7 +320,7 @@ export class Timeline extends React.Component<
       }
     }
 
-    if (this.active === 'leftDraggable') {
+    if (this._active === 'leftDraggable') {
       if (this._scrollContainer.current && this._scrollbarHandle.current) {
         let moving =
           e.clientX -
@@ -355,7 +352,7 @@ export class Timeline extends React.Component<
       }
     }
 
-    if (this.active === 'rightDraggable') {
+    if (this._active === 'rightDraggable') {
       if (this._scrollContainer.current && this._scrollbarHandle.current) {
         let moving =
           e.clientX -
@@ -382,7 +379,7 @@ export class Timeline extends React.Component<
   scrollDragEnd(e: any) {
     e.preventDefault();
     this._scrolling = false;
-    this.active = '';
+    this._active = '';
     this._shiftX = 0;
   }