liwei 1 tahun lalu
induk
melakukan
ddae973298

+ 1 - 1
src/modules/editor/components/CompUI/basicUI/Image2/index.ts

@@ -14,7 +14,7 @@ export const { createComp, useCompData } = createCompHooks({
     url: Dict_Imgs.Default,
     x: 0,
     y: 0,
-    s: 1.875,
+    s: 1,
     showLink: false,
     offsetUnit: "%",
     link: "",

+ 26 - 39
src/modules/editor/components/CompUI/customUI/Cards/Card2/component.tsx

@@ -5,6 +5,7 @@ import { useEditor } from "../../../../..";
 import { Image, Text } from "../../../basicUI";
 import { createUIComp } from "../../../defines/createUIComp";
 import { WidthEditlayer } from "../../../basicUI/utils";
+import { View } from "../../../basicUI/View";
 
 export const Component = createUIComp({
   props: {
@@ -19,60 +20,48 @@ export const Component = createUIComp({
     { 
         const item1Comp = store.compMap[id]
         if ( !item1Comp ) return;
-        const isDefault = item1Comp.layout.size[0] == 750 && item1Comp.layout.size[1] == 400
-        if (isDefault) {
-          item1Comp.layout.size[0] = w;
-          item1Comp.layout.size[1] = h;
+
+        if (item1Comp.layout.size) {
+          const isDefault = item1Comp.layout.size[0] == 750 && item1Comp.layout.size[1] == 400
+          if (isDefault) {
+            item1Comp.layout.size[0] = w;
+            item1Comp.layout.size[1] = h;
+          }
         }
     }
+    
     fixedSize(children.item1, 191, 191);
     fixedSize(children.item2, 191, 191);
     fixedSize(children.item3, 191, 191);
 
 
     return () => (
-      <div class="relative">
-        <div class="relative">
+      <div class="absolute">
           <div class={style}>
             <Image.Component compId={children.bgImg} />
           </div>
-          <div
-            class="absolute bottom-0 w-1/1 pl-40px pr-10px flex items-end justify-between transform translate-y-1/3"
-            style={{
-              height: designToNaturalSize(191),
-            }}
-          >
-          
-                <Image.Component
-                  class="rounded-1/2 overflow-hidden"
-                  editlayer = {false}
-                  compId={children.item1}
-                />
-       
-              <Image.Component
-                class="rounded-1/2 overflow-hidden"
-                style={{
-                  marginBottom: designToNaturalSize(191 / 3),
-                }}
-                compId={children.item2}
+
+          <Image.Component
+                class="rounded-1/2 overflow-hidden top-0"
                 editlayer = {false}
+                compId={children.item1}
               />
-              
-              <Image.Component
-                  class="rounded-1/2 overflow-hidden"
-                  style={{
-                    marginBottom: designToNaturalSize((191 / 3) * 2),
-                  }}
+
+            <Image.Component
+                      class="rounded-1/2 overflow-hidden top-0"
+                      compId={children.item2}
+                      editlayer = {false}
+                    />   
+
+          <Image.Component
+                  class="rounded-1/2 overflow-hidden top-0"
                   compId={children.item3}
                   editlayer = {false}
               />
 
-          </div>
-        </div>
-        <div class="absolute top-50px left-0 z-1">
-          <Text.Component compId={children.text1} />
-        </div>
-        <Text.Component compId={children.text2} class="mt-15px" />
+        <Text.Component compId={children.text1} class={"top-0"} />
+        
+        <Text.Component compId={children.text2} class={"top-0"} />
       </div>
     );
   },
@@ -81,6 +70,4 @@ export const Component = createUIComp({
 const style = css`
   background: gray;
   clip-path: polygon(0 0, 100% 0, 100% 57%, 0 100%);
-  transform-origin: center;
-  transform: translate(0%, 0%) scale(1);
 `;

+ 15 - 3
src/modules/editor/components/CompUI/customUI/Cards/Card2/index.tsx

@@ -29,27 +29,35 @@ export const { createComp, useCompData } = createCompHooks({
         },
         layout: {
           size: [750, 464],
+          transformMatrix:"matrix(1,0,0,1,0,0)"
         },
       }),
+
     item1: () =>
       createCompId("Image", {
         value: { url: thumbnail, x: 26.5, y: -23.0, s: 4.05 },
         layout: {
-          size: [191, 191]
+          size: [191, 191],
+          transformMatrix:"matrix(1,0,0,1, 40, 170)",
+          position:"absolute",
         }
       }),
     item2: () =>
       createCompId("Image", {
         value: { url: thumbnail, x: -4.0, y: -13.5, s: 3.9 },
         layout: {
-          size: [191, 191]
+          size: [191, 191],
+          transformMatrix:"matrix(1, 0, 0, 1, 153, 136)",
+          position:"absolute",
         }
       }),
     item3: () =>
       createCompId("Image", {
         value: { url: thumbnail, x: -34.0, y: -3.5, s: 4.0 },
         layout: {
-          size: [191, 191]
+          size: [191, 191],
+          transformMatrix: "matrix(1, 0, 0, 1, 269, 100)",
+          position:"absolute",
         }
       }),
     text1: () =>
@@ -57,6 +65,8 @@ export const { createComp, useCompData } = createCompHooks({
         value: `<p style="line-height:1.5;"><span style="font-size:42px;"><strong>&nbsp; </strong></span><span style="color:hsl(0, 0%, 100%);font-size:42px;"><strong>P190</strong></span></p><p style="line-height:1.5;"><span style="color:hsl(0, 0%, 100%);font-size:20px;">&nbsp; &nbsp; &nbsp;可注塑</span></p>`,
         layout: {
           size: [750, 200],
+          transformMatrix:"matrix(1,0,0,1,0, 50)",
+          position:"absolute",
         },
       }),
     text2: () =>
@@ -64,6 +74,8 @@ export const { createComp, useCompData } = createCompHooks({
         value: `<p style="text-align:right;line-height:1.5;"><span style="color:hsl(0, 0%, 0%);font-size:14px;">全新 &nbsp;| &nbsp;时尚 &nbsp;| &nbsp;简约 &nbsp;</span></p>`,
         layout: {
           size: [750, 40],
+          transformMatrix:"matrix(1,0,0,1, 0, 248)",
+          position:"absolute",
         },
       }),
   },

+ 0 - 4
src/modules/editor/components/CompUI/customUI/Cards/Card5/component.tsx

@@ -19,10 +19,6 @@ export const Component = createUIComp({
         </div>
         <div class="flex justify-center">
           <Image.Component
-            style={{
-              width: designToNaturalSize(368),
-              height: designToNaturalSize(275),
-            }}
             compId={children.bgImg}
           />
         </div>

+ 1 - 1
src/modules/editor/components/CompUI/customUI/Cards/Card5/index.ts

@@ -25,7 +25,7 @@ export const { createComp, useCompData } = createCompHooks({
           url: require("@/assets/comps/Card14/img_shoe.png"),
         },
         layout: {
-          size: [750, 275],
+          size: [368, 275],
         },
       }),
     text1: () =>

+ 1 - 1
src/modules/editor/controllers/SelectCtrl/assistMagnetCtrl.ts

@@ -66,7 +66,7 @@ export class AssistMagnetCtrl {
         
         if ( !this.enable ) return;
 
-        const eps = 6;
+        const eps = 4;
         const Objc = this.ctrl.objContainer as ObjsContainer
         const bund = Objc.getBound();
         const box = this.ctrl.getCurrCardBox();