master
Beau Blyth 2019-09-30 21:58:04 -07:00
parent 8e62001389
commit c47608c013
2 changed files with 6 additions and 4 deletions

View File

@ -1,6 +1,6 @@
import { IAnimationData } from './Interfaces/IAnimationData'; import { IAnimationData } from './Interfaces/IAnimationData';
import { IProjectData } from './Interfaces/IProjectData';
import { IFramePinData } from './Interfaces/IFramePinData'; import { IFramePinData } from './Interfaces/IFramePinData';
import { IProjectData } from './Interfaces/IProjectData';
export class FrameHandler { export class FrameHandler {
private start: number = 0; private start: number = 0;
@ -74,7 +74,7 @@ export class FrameHandler {
public TogglePlayingAnimation() { public TogglePlayingAnimation() {
this.playingAnimation = !this.playingAnimation; this.playingAnimation = !this.playingAnimation;
if (this.playingAnimation && this.currentFrame == this.filenames.length - 1 && !this.animationData.loop) { if (this.playingAnimation && this.currentFrame === this.filenames.length - 1 && !this.animationData.loop) {
this.currentFrame = -1; this.currentFrame = -1;
} }
console.log('playingAnimation = ', this.playingAnimation); console.log('playingAnimation = ', this.playingAnimation);
@ -116,7 +116,9 @@ export class FrameHandler {
// draw pins // draw pins
for (let i = 0; i < 10; i++) { for (let i = 0; i < 10; i++) {
this.canvasContext.strokeStyle = '#FF0000'; this.canvasContext.strokeStyle = '#FF0000';
let currentSelectedPinData: IFramePinData = this.animationData.frames[this.projectData.currentFrame][i]; const currentSelectedPinData: IFramePinData = this.animationData.frames[this.projectData.currentFrame][
i
];
if (currentSelectedPinData !== null && currentSelectedPinData !== undefined) { if (currentSelectedPinData !== null && currentSelectedPinData !== undefined) {
this.DrawCrossHair(50, this.canvasContext, currentSelectedPinData.x, currentSelectedPinData.y); this.DrawCrossHair(50, this.canvasContext, currentSelectedPinData.x, currentSelectedPinData.y);
} }

View File

@ -4,8 +4,8 @@ import { CanvasHandler } from './canvas_handler';
import { FileHandler } from './file_handler'; import { FileHandler } from './file_handler';
import { FrameHandler } from './frame_handler'; import { FrameHandler } from './frame_handler';
import { IAnimationData } from './Interfaces/IAnimationData'; import { IAnimationData } from './Interfaces/IAnimationData';
import { IProjectData } from './Interfaces/IProjectData';
import { IFrame } from './Interfaces/IFrame'; import { IFrame } from './Interfaces/IFrame';
import { IProjectData } from './Interfaces/IProjectData';
import { PinHandler } from './pin_handler'; import { PinHandler } from './pin_handler';
export class Page { export class Page {