diff --git a/public/js/fabric.brushes.js b/public/js/fabric.brushes.js
index e6ecf90c..c5e63310 100644
--- a/public/js/fabric.brushes.js
+++ b/public/js/fabric.brushes.js
@@ -127,7 +127,6 @@ fabric.Point.prototype.normalize = function(thickness) {
* This makes the drawing editable, it can be moved, rotated, scaled, skewed etc.
*/
fabric.BaseBrush.prototype.convertToPath = function() {
- console.log(this.canvas.upperCanvasEl);
var pixelRatio = this.canvas.getRetinaScaling(),
c = fabric.util.copyCanvasElement(this.canvas.upperCanvasEl),
xy = fabric.util.trimCanvas(c),
@@ -147,13 +146,16 @@ fabric.BaseBrush.prototype.convertToPath = function() {
strokeWidth: this._width,
stroke: 'black',
fill:'transparent',
+ custom:{
+ dashed:true
+ },
}).setCoords();
let group = new fabric.Group([pathElemetn],{
left:((xy.x)/pixelRatio-pointerX)/this.canvas.getZoom(),
top:((xy.y)/pixelRatio-pointerY)/this.canvas.getZoom(),
custom:{
dashed:true
- }
+ },
})
this.canvas.add(group).clearContext(this.canvas.contextTop);
diff --git a/src/component/HomePage/bindEmail.vue b/src/component/HomePage/bindEmail.vue
index e2b231b5..548b3886 100644
--- a/src/component/HomePage/bindEmail.vue
+++ b/src/component/HomePage/bindEmail.vue
@@ -51,7 +51,7 @@
:class="{active:!!email && bindType != 'Modify'}"
placeholder="Enter your email address"
v-model="email"
- :disabled="!!email && bindType != 'Modify'"
+ :disabled="!!userDetail.email && bindType != 'Modify'"
@keydown.enter="submitPerLogin()"
/>
diff --git a/src/store/userHabit/userHabit.ts b/src/store/userHabit/userHabit.ts
index 57977168..739badf5 100644
--- a/src/store/userHabit/userHabit.ts
+++ b/src/store/userHabit/userHabit.ts
@@ -210,6 +210,8 @@ const userHabit : Module = {
state.userDetail.occupation = data.occupation//头像
state.userDetail.usernameModify = data.usernameModify//当月剩余修改次数
state.userDetail.isBeginner = data.isBeginner == 1 ? true : false;//是否完成新手指引
+ console.log(data);
+
if(
(!data.email && state.userDetail.email == '-------------') ||
(!data.country && !state.userDetail.country) ||
@@ -345,7 +347,10 @@ const userHabit : Module = {
let getUserDetail = ()=>{
return new Promise((resolve,reject) => {
Https.axiosPost(Https.httpUrls.accountDetail).then((rv: any) => {
+ console.log(rv,'rv1');
if(rv){
+ console.log(rv,'rv');
+
context.commit('setUserDetail',rv)
}
resolve('')
diff --git a/src/tool/canvasGeneralCopy.js b/src/tool/canvasGeneralCopy.js
index 93c8e84c..b5a48c74 100644
--- a/src/tool/canvasGeneralCopy.js
+++ b/src/tool/canvasGeneralCopy.js
@@ -429,8 +429,7 @@ class MyCanvas {
getActiveObject &&
getActiveObject.custom.dashed &&
this.layer.selectLayer.group.custom?.groupType == 'Grid' &&
- this.operation == 'movePosition' &&
- getActiveObject._objects.length == 1
+ this.operation == 'movePosition'
){
this.setclipPathImg()
}
@@ -625,7 +624,6 @@ class MyCanvas {
});
MyCanvas.canvas.bringToFront(this.createPatterning.polyLineBtn);//设置优先级最高
}else if(this.operation){
- console.log(23232);
this.createPatterning.state = false
MyCanvas.canvas.renderAll();
if(this.operation == 'dashed'){
@@ -642,8 +640,7 @@ class MyCanvas {
async setclipPathImg(){//裁剪图片
if(!this.clipPath.clipGroup)return
this.clipPath.isImg = true
-
- let clipPathElement = this.clipPath.clipGroup._objects.filter(obj => obj.type != 'image')[0]
+ let clipPathElement = this.clipPath.clipGroup._objects.filter(obj => obj.custom)[0]
let imgBG = MyCanvas.canvas.getObjects().filter(obj => obj.custom.isSelectable && obj.type == 'rect')[0];
let position = {
left:this.clipPath.clipGroup?.left - (imgBG.left?imgBG.left:0),
@@ -1432,7 +1429,8 @@ class MyCanvas {
height: MyCanvas.canvas.height
}))
}
- addLayer(options){
+ async addLayer(options){
+ console.log(options);
if(this.createPatterning.state)return
this.clipPath.clipGroup = MyCanvas.canvas.getObjects().filter(obj => obj.custom?.dashed)?.[0];
if (options.target.type === 'group' && options.target.custom?.layerId) return;
@@ -1472,8 +1470,35 @@ class MyCanvas {
})
if(!options?.target?.custom?.dashed && this.layer.selectLayer.group.custom.groupType == 'Grid'){
- console.log(this.layer.selectLayer.group);
- this.layer.selectLayer.group.add(options.target)
+ await new Promise((resolve, reject) => {
+ let clipPathElement = this.clipPath.clipGroup._objects.filter(obj => obj.custom)[0]
+ let clipPathLect = this.clipPath.clipGroup.left
+ let clipPathTop = this.clipPath.clipGroup.top
+
+ clipPathElement.clone((clipPathElementCloned)=>{
+ clipPathElementCloned.set({
+ // left:this.clipPath.clipGroup.left,
+ // top:this.clipPath.clipGroup.top,
+ left:clipPathLect,
+ top:clipPathTop,
+ absolutePositioned:true,
+ })
+ let optionLect = (options.target.left - this.clipPath.clipGroup.left) - this.clipPath.clipGroup.width/2
+ let optionTop = (options.target.top - this.clipPath.clipGroup.top) - this.clipPath.clipGroup.height/2
+ options.target.clone((cloned)=>{
+ cloned.set({
+ left:optionLect,
+ top:optionTop,
+ clipPath:clipPathElementCloned,
+ })
+ this.clipPath.clipGroup.add(cloned)
+ console.log(this.clipPath.clipGroup);
+ MyCanvas.canvas.remove(options.target)
+ resolve()
+ })
+ })
+ })
+
// this.setGroupGrid('all')
}
diff --git a/src/views/HomeView/HomeView.vue b/src/views/HomeView/HomeView.vue
index 847ddae7..b8799aa4 100644
--- a/src/views/HomeView/HomeView.vue
+++ b/src/views/HomeView/HomeView.vue
@@ -804,6 +804,10 @@ export default defineComponent({
// type: 'dislike',
// };
// designDetail.showDesignDetailModal(data);
+ window.addEventListener('resize', ()=> {
+ this.setSystemDesigner(0)
+ this.setDesignItemStyle()
+ })
this.setSystemDesigner(0)
this.setDesignItemStyle()
},