|
@@ -12,13 +12,13 @@ export const Component = createUIComp({
|
|
compId: string().isRequired,
|
|
compId: string().isRequired,
|
|
},
|
|
},
|
|
setup(props) {
|
|
setup(props) {
|
|
- const { store , helper} = useEditor();
|
|
|
|
|
|
+ const { store , helper, controls} = useEditor();
|
|
const { children } = useCompData(props.compId);
|
|
const { children } = useCompData(props.compId);
|
|
|
|
|
|
const designToNaturalSize = helper.designToNaturalSize;
|
|
const designToNaturalSize = helper.designToNaturalSize;
|
|
function fixedSize(id:string, w:number, h:number)
|
|
function fixedSize(id:string, w:number, h:number)
|
|
{
|
|
{
|
|
- const item1Comp = store.compMap[id]
|
|
|
|
|
|
+ const item1Comp = controls.pageCtrl.compMap[id]
|
|
if ( !item1Comp ) return;
|
|
if ( !item1Comp ) return;
|
|
|
|
|
|
if (item1Comp.layout.size) {
|
|
if (item1Comp.layout.size) {
|
|
@@ -31,17 +31,17 @@ export const Component = createUIComp({
|
|
}
|
|
}
|
|
|
|
|
|
function upgrade() {
|
|
function upgrade() {
|
|
- const bgComp = store.compMap[children.bgImg]
|
|
|
|
|
|
+ const bgComp = controls.pageCtrl.compMap[children.bgImg]
|
|
if (bgComp.layout.size == undefined || bgComp.layout.size[1] != 464) {
|
|
if (bgComp.layout.size == undefined || bgComp.layout.size[1] != 464) {
|
|
bgComp.layout.size = [750, 464]
|
|
bgComp.layout.size = [750, 464]
|
|
}
|
|
}
|
|
- const item1Comp = store.compMap[children.item1]
|
|
|
|
|
|
+ const item1Comp = controls.pageCtrl.compMap[children.item1]
|
|
if ( !item1Comp.layout.transformMatrix) {
|
|
if ( !item1Comp.layout.transformMatrix) {
|
|
item1Comp.layout.transformMatrix = "matrix(1,0,0,1, 40, 170)"
|
|
item1Comp.layout.transformMatrix = "matrix(1,0,0,1, 40, 170)"
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- const item2Comp = store.compMap[children.item2]
|
|
|
|
|
|
+ const item2Comp = controls.pageCtrl.compMap[children.item2]
|
|
if ( !item2Comp.layout.transformMatrix) {
|
|
if ( !item2Comp.layout.transformMatrix) {
|
|
|
|
|
|
item2Comp.layout.transformMatrix = "matrix(1, 0, 0, 1, 153, 136)",
|
|
item2Comp.layout.transformMatrix = "matrix(1, 0, 0, 1, 153, 136)",
|
|
@@ -49,21 +49,21 @@ export const Component = createUIComp({
|
|
item2Comp.layout.position = "absolute";
|
|
item2Comp.layout.position = "absolute";
|
|
}
|
|
}
|
|
|
|
|
|
- const item3Comp = store.compMap[children.item3]
|
|
|
|
|
|
+ const item3Comp = controls.pageCtrl.compMap[children.item3]
|
|
if ( !item3Comp.layout.transformMatrix) {
|
|
if ( !item3Comp.layout.transformMatrix) {
|
|
item3Comp.layout.transformMatrix = "matrix(1, 0, 0, 1, 269, 100)",
|
|
item3Comp.layout.transformMatrix = "matrix(1, 0, 0, 1, 269, 100)",
|
|
//@ts-ignore
|
|
//@ts-ignore
|
|
item3Comp.layout.position = "absolute";
|
|
item3Comp.layout.position = "absolute";
|
|
}
|
|
}
|
|
|
|
|
|
- const text1Comp = store.compMap[children.text1]
|
|
|
|
|
|
+ const text1Comp = controls.pageCtrl.compMap[children.text1]
|
|
if ( !text1Comp.layout.transformMatrix) {
|
|
if ( !text1Comp.layout.transformMatrix) {
|
|
text1Comp.layout.transformMatrix = "matrix(1,0,0,1,0, 50)",
|
|
text1Comp.layout.transformMatrix = "matrix(1,0,0,1,0, 50)",
|
|
//@ts-ignore
|
|
//@ts-ignore
|
|
text1Comp.layout.position = "absolute";
|
|
text1Comp.layout.position = "absolute";
|
|
}
|
|
}
|
|
|
|
|
|
- const text2Comp = store.compMap[children.text2]
|
|
|
|
|
|
+ const text2Comp = controls.pageCtrl.compMap[children.text2]
|
|
if ( !text2Comp.layout.transformMatrix) {
|
|
if ( !text2Comp.layout.transformMatrix) {
|
|
text2Comp.layout.transformMatrix = "matrix(1,0,0,1, 0, 248)",
|
|
text2Comp.layout.transformMatrix = "matrix(1,0,0,1, 0, 248)",
|
|
//@ts-ignore
|
|
//@ts-ignore
|