mirror of
https://github.com/igorski/bitmappery.git
synced 2026-07-23 23:37:42 +02:00
Loaded image files now appear on screen
This commit is contained in:
25
src/store/modules/document-module.js
Normal file
25
src/store/modules/document-module.js
Normal file
@@ -0,0 +1,25 @@
|
||||
import Vue from 'vue';
|
||||
import DocumentFactory from '@/factories/document-factory';
|
||||
import LayerFactory from '@/factories/layer-factory';
|
||||
import GraphicFactory from '@/factories/graphic-factory';
|
||||
|
||||
export default {
|
||||
state: {
|
||||
document: DocumentFactory.create(),
|
||||
},
|
||||
getters: {
|
||||
document: state => state.document,
|
||||
layers: state => state.document.layers,
|
||||
},
|
||||
mutations: {
|
||||
addLayer( state ) {
|
||||
state.document.layers.push( LayerFactory.create() );
|
||||
},
|
||||
addGraphicToLayer( state, { index, bitmap }) {
|
||||
state.document.layers[ index ]?.graphics.push( GraphicFactory.create( bitmap ));
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user