refactoring: converting all static commun paper objects (like backgrounds) into symbols for perf optimization
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
import paper from 'paper';
|
||||
|
||||
export const CommonStore = defineStore({
|
||||
id: 'common',
|
||||
state: () => ({
|
||||
hover_elmt: null,
|
||||
cartouch_width: 450
|
||||
cartouch_width: 450,
|
||||
paper_symbol_definitions: {}
|
||||
}),
|
||||
getters: {
|
||||
|
||||
@@ -14,6 +17,12 @@ export const CommonStore = defineStore({
|
||||
// console.log(`setHoverElmt`, elmt);
|
||||
// mode can be : terraindevie, proximite, superposition, puissancedagir, action, doleancer
|
||||
this.hover_elmt = elmt;
|
||||
},
|
||||
addPaperSymbolDefinition(name, path) {
|
||||
console.log(`addPaperSymbolDefinition ${name}`, path);
|
||||
// mode can be : terraindevie, proximite, superposition, puissancedagir, action, doleancer
|
||||
this.paper_symbol_definitions[name] = new paper.SymbolDefinition(path);
|
||||
}
|
||||
|
||||
}
|
||||
})
|
Reference in New Issue
Block a user