fix
This commit is contained in:
@@ -127,7 +127,6 @@ fabric.Point.prototype.normalize = function(thickness) {
|
|||||||
* This makes the drawing editable, it can be moved, rotated, scaled, skewed etc.
|
* This makes the drawing editable, it can be moved, rotated, scaled, skewed etc.
|
||||||
*/
|
*/
|
||||||
fabric.BaseBrush.prototype.convertToPath = function() {
|
fabric.BaseBrush.prototype.convertToPath = function() {
|
||||||
console.log(this.canvas.upperCanvasEl);
|
|
||||||
var pixelRatio = this.canvas.getRetinaScaling(),
|
var pixelRatio = this.canvas.getRetinaScaling(),
|
||||||
c = fabric.util.copyCanvasElement(this.canvas.upperCanvasEl),
|
c = fabric.util.copyCanvasElement(this.canvas.upperCanvasEl),
|
||||||
xy = fabric.util.trimCanvas(c),
|
xy = fabric.util.trimCanvas(c),
|
||||||
@@ -147,13 +146,16 @@ fabric.BaseBrush.prototype.convertToPath = function() {
|
|||||||
strokeWidth: this._width,
|
strokeWidth: this._width,
|
||||||
stroke: 'black',
|
stroke: 'black',
|
||||||
fill:'transparent',
|
fill:'transparent',
|
||||||
|
custom:{
|
||||||
|
dashed:true
|
||||||
|
},
|
||||||
}).setCoords();
|
}).setCoords();
|
||||||
let group = new fabric.Group([pathElemetn],{
|
let group = new fabric.Group([pathElemetn],{
|
||||||
left:((xy.x)/pixelRatio-pointerX)/this.canvas.getZoom(),
|
left:((xy.x)/pixelRatio-pointerX)/this.canvas.getZoom(),
|
||||||
top:((xy.y)/pixelRatio-pointerY)/this.canvas.getZoom(),
|
top:((xy.y)/pixelRatio-pointerY)/this.canvas.getZoom(),
|
||||||
custom:{
|
custom:{
|
||||||
dashed:true
|
dashed:true
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
this.canvas.add(group).clearContext(this.canvas.contextTop);
|
this.canvas.add(group).clearContext(this.canvas.contextTop);
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
:class="{active:!!email && bindType != 'Modify'}"
|
:class="{active:!!email && bindType != 'Modify'}"
|
||||||
placeholder="Enter your email address"
|
placeholder="Enter your email address"
|
||||||
v-model="email"
|
v-model="email"
|
||||||
:disabled="!!email && bindType != 'Modify'"
|
:disabled="!!userDetail.email && bindType != 'Modify'"
|
||||||
@keydown.enter="submitPerLogin()"
|
@keydown.enter="submitPerLogin()"
|
||||||
/>
|
/>
|
||||||
<div v-if="bindType != 'Modify'">
|
<div v-if="bindType != 'Modify'">
|
||||||
|
|||||||
@@ -210,6 +210,8 @@ const userHabit : Module<UserHabit,RootState> = {
|
|||||||
state.userDetail.occupation = data.occupation//头像
|
state.userDetail.occupation = data.occupation//头像
|
||||||
state.userDetail.usernameModify = data.usernameModify//当月剩余修改次数
|
state.userDetail.usernameModify = data.usernameModify//当月剩余修改次数
|
||||||
state.userDetail.isBeginner = data.isBeginner == 1 ? true : false;//是否完成新手指引
|
state.userDetail.isBeginner = data.isBeginner == 1 ? true : false;//是否完成新手指引
|
||||||
|
console.log(data);
|
||||||
|
|
||||||
if(
|
if(
|
||||||
(!data.email && state.userDetail.email == '-------------') ||
|
(!data.email && state.userDetail.email == '-------------') ||
|
||||||
(!data.country && !state.userDetail.country) ||
|
(!data.country && !state.userDetail.country) ||
|
||||||
@@ -345,7 +347,10 @@ const userHabit : Module<UserHabit,RootState> = {
|
|||||||
let getUserDetail = ()=>{
|
let getUserDetail = ()=>{
|
||||||
return new Promise((resolve,reject) => {
|
return new Promise((resolve,reject) => {
|
||||||
Https.axiosPost(Https.httpUrls.accountDetail).then((rv: any) => {
|
Https.axiosPost(Https.httpUrls.accountDetail).then((rv: any) => {
|
||||||
|
console.log(rv,'rv1');
|
||||||
if(rv){
|
if(rv){
|
||||||
|
console.log(rv,'rv');
|
||||||
|
|
||||||
context.commit('setUserDetail',rv)
|
context.commit('setUserDetail',rv)
|
||||||
}
|
}
|
||||||
resolve('')
|
resolve('')
|
||||||
|
|||||||
@@ -429,8 +429,7 @@ class MyCanvas {
|
|||||||
getActiveObject &&
|
getActiveObject &&
|
||||||
getActiveObject.custom.dashed &&
|
getActiveObject.custom.dashed &&
|
||||||
this.layer.selectLayer.group.custom?.groupType == 'Grid' &&
|
this.layer.selectLayer.group.custom?.groupType == 'Grid' &&
|
||||||
this.operation == 'movePosition' &&
|
this.operation == 'movePosition'
|
||||||
getActiveObject._objects.length == 1
|
|
||||||
){
|
){
|
||||||
this.setclipPathImg()
|
this.setclipPathImg()
|
||||||
}
|
}
|
||||||
@@ -625,7 +624,6 @@ class MyCanvas {
|
|||||||
});
|
});
|
||||||
MyCanvas.canvas.bringToFront(this.createPatterning.polyLineBtn);//设置优先级最高
|
MyCanvas.canvas.bringToFront(this.createPatterning.polyLineBtn);//设置优先级最高
|
||||||
}else if(this.operation){
|
}else if(this.operation){
|
||||||
console.log(23232);
|
|
||||||
this.createPatterning.state = false
|
this.createPatterning.state = false
|
||||||
MyCanvas.canvas.renderAll();
|
MyCanvas.canvas.renderAll();
|
||||||
if(this.operation == 'dashed'){
|
if(this.operation == 'dashed'){
|
||||||
@@ -642,8 +640,7 @@ class MyCanvas {
|
|||||||
async setclipPathImg(){//裁剪图片
|
async setclipPathImg(){//裁剪图片
|
||||||
if(!this.clipPath.clipGroup)return
|
if(!this.clipPath.clipGroup)return
|
||||||
this.clipPath.isImg = true
|
this.clipPath.isImg = true
|
||||||
|
let clipPathElement = this.clipPath.clipGroup._objects.filter(obj => obj.custom)[0]
|
||||||
let clipPathElement = this.clipPath.clipGroup._objects.filter(obj => obj.type != 'image')[0]
|
|
||||||
let imgBG = MyCanvas.canvas.getObjects().filter(obj => obj.custom.isSelectable && obj.type == 'rect')[0];
|
let imgBG = MyCanvas.canvas.getObjects().filter(obj => obj.custom.isSelectable && obj.type == 'rect')[0];
|
||||||
let position = {
|
let position = {
|
||||||
left:this.clipPath.clipGroup?.left - (imgBG.left?imgBG.left:0),
|
left:this.clipPath.clipGroup?.left - (imgBG.left?imgBG.left:0),
|
||||||
@@ -1432,7 +1429,8 @@ class MyCanvas {
|
|||||||
height: MyCanvas.canvas.height
|
height: MyCanvas.canvas.height
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
addLayer(options){
|
async addLayer(options){
|
||||||
|
console.log(options);
|
||||||
if(this.createPatterning.state)return
|
if(this.createPatterning.state)return
|
||||||
this.clipPath.clipGroup = MyCanvas.canvas.getObjects().filter(obj => obj.custom?.dashed)?.[0];
|
this.clipPath.clipGroup = MyCanvas.canvas.getObjects().filter(obj => obj.custom?.dashed)?.[0];
|
||||||
if (options.target.type === 'group' && options.target.custom?.layerId) return;
|
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'){
|
if(!options?.target?.custom?.dashed && this.layer.selectLayer.group.custom.groupType == 'Grid'){
|
||||||
console.log(this.layer.selectLayer.group);
|
await new Promise((resolve, reject) => {
|
||||||
this.layer.selectLayer.group.add(options.target)
|
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')
|
// this.setGroupGrid('all')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -804,6 +804,10 @@ export default defineComponent({
|
|||||||
// type: 'dislike',
|
// type: 'dislike',
|
||||||
// };
|
// };
|
||||||
// designDetail.showDesignDetailModal(data);
|
// designDetail.showDesignDetailModal(data);
|
||||||
|
window.addEventListener('resize', ()=> {
|
||||||
|
this.setSystemDesigner(0)
|
||||||
|
this.setDesignItemStyle()
|
||||||
|
})
|
||||||
this.setSystemDesigner(0)
|
this.setSystemDesigner(0)
|
||||||
this.setDesignItemStyle()
|
this.setDesignItemStyle()
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user