change animation metadata def

pull/2/head
thatcosmonaut 2019-12-12 12:09:00 -08:00
parent 583844b880
commit f72166f9b6
7 changed files with 11 additions and 15 deletions

View File

@ -1,6 +1,6 @@
import { IFramePinData } from './IFramePinData'; import { IPositionData } from './IPositionData';
export interface IFrame { export interface IFrame {
filename: string; filename: string;
pinData: IFramePinData; pinData: IPositionData[];
} }

View File

@ -1,6 +0,0 @@
export interface IFramePinData {
[id: number]: {
x: number;
y: number;
};
}

View File

@ -0,0 +1,4 @@
export interface IPositionData {
x: number;
y: number;
}

View File

@ -1,5 +1,4 @@
import { IAnimationData } from './Interfaces/IAnimationData'; import { IAnimationData } from './Interfaces/IAnimationData';
import { IFramePinData } from './Interfaces/IFramePinData';
import { IProjectData } from './Interfaces/IProjectData'; import { IProjectData } from './Interfaces/IProjectData';
// I display the canvas and am clickable // I display the canvas and am clickable

View File

@ -1,5 +1,4 @@
import { IAnimationData } from './Interfaces/IAnimationData'; import { IAnimationData } from './Interfaces/IAnimationData';
import { IFramePinData } from './Interfaces/IFramePinData';
import { IProjectData } from './Interfaces/IProjectData'; import { IProjectData } from './Interfaces/IProjectData';
export class FrameHandler { export class FrameHandler {

View File

@ -45,7 +45,7 @@ export class Page {
frames: [ frames: [
{ {
filename: '', filename: '',
pinData: {} pinData: []
} }
], ],
loop: true, loop: true,
@ -316,7 +316,7 @@ export class Page {
for (let i = 0; i < originalFilenames.length; i++) { for (let i = 0; i < originalFilenames.length; i++) {
newFrames.push({ newFrames.push({
filename: originalFilenames[i].toString(), filename: originalFilenames[i].toString(),
pinData: {} pinData: []
}); });
} }
@ -341,7 +341,7 @@ export class Page {
this.animationData.originY = null; this.animationData.originY = null;
this.animationData.frameRate = 30; this.animationData.frameRate = 30;
this.animationData.loop = true; this.animationData.loop = true;
this.animationData.frames = [ { filename: '', pinData: {} } ]; this.animationData.frames = [ { filename: '', pinData: [] } ];
// blank slate canvas data // blank slate canvas data
this.projectData.currentFrame = 0; this.projectData.currentFrame = 0;

View File

@ -8,7 +8,7 @@ module.exports = {
main: [ './index.ts' ] main: [ './index.ts' ]
}, },
output: { output: {
filename: 'exporter/bundle.js' filename: 'bundle.js'
}, },
resolve: { resolve: {
// Add `.ts` and `.tsx` as a resolvable extension. // Add `.ts` and `.tsx` as a resolvable extension.
@ -16,7 +16,7 @@ module.exports = {
}, },
plugins: [ plugins: [
new MiniCssExtractPlugin({ new MiniCssExtractPlugin({
filename: 'exporter/main.css' filename: 'main.css'
}) })
], ],
module: { module: {