수동 기능 작업
This commit is contained in:
parent
b7c3af0adb
commit
8dbdc8d644
@ -227,7 +227,7 @@ export function useModuleBasicSetting() {
|
|||||||
tempModule = new fabric.Rect({
|
tempModule = new fabric.Rect({
|
||||||
fill: 'white',
|
fill: 'white',
|
||||||
stroke: 'black',
|
stroke: 'black',
|
||||||
strokeWidth: 1,
|
strokeWidth: 0.3,
|
||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
left: mousePoint.x - width / 2,
|
left: mousePoint.x - width / 2,
|
||||||
@ -1600,7 +1600,7 @@ export function useModuleBasicSetting() {
|
|||||||
const mousePoint = canvas.getPointer(e.e)
|
const mousePoint = canvas.getPointer(e.e)
|
||||||
|
|
||||||
for (let i = 0; i < moduleSetupSurfaces.length; i++) {
|
for (let i = 0; i < moduleSetupSurfaces.length; i++) {
|
||||||
turfPolygon = polygonToTurfPolygon(moduleSetupSurfaces[i])
|
turfPolygon = polygonToTurfPolygon(moduleSetupSurfaces[i], true)
|
||||||
trestlePolygon = moduleSetupSurfaces[i]
|
trestlePolygon = moduleSetupSurfaces[i]
|
||||||
manualDrawModules = moduleSetupSurfaces[i].modules // 앞에서 자동으로 했을때 추가됨
|
manualDrawModules = moduleSetupSurfaces[i].modules // 앞에서 자동으로 했을때 추가됨
|
||||||
flowDirection = moduleSetupSurfaces[i].flowDirection //도형의 방향
|
flowDirection = moduleSetupSurfaces[i].flowDirection //도형의 방향
|
||||||
@ -1625,7 +1625,7 @@ export function useModuleBasicSetting() {
|
|||||||
tempModule = new fabric.Rect({
|
tempModule = new fabric.Rect({
|
||||||
fill: 'white',
|
fill: 'white',
|
||||||
stroke: 'black',
|
stroke: 'black',
|
||||||
strokeWidth: 1,
|
strokeWidth: 0.3,
|
||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
left: mousePoint.x - width / 2,
|
left: mousePoint.x - width / 2,
|
||||||
@ -1831,8 +1831,6 @@ export function useModuleBasicSetting() {
|
|||||||
//마우스 클릭시 set으로 해당 위치에 셀을 넣음
|
//마우스 클릭시 set으로 해당 위치에 셀을 넣음
|
||||||
const isOverlap = manualDrawModules.some((module) => turf.booleanOverlap(tempTurfModule, polygonToTurfPolygon(module))) //겹치는지 확인
|
const isOverlap = manualDrawModules.some((module) => turf.booleanOverlap(tempTurfModule, polygonToTurfPolygon(module))) //겹치는지 확인
|
||||||
if (!isOverlap) {
|
if (!isOverlap) {
|
||||||
console.log('tempModule.points', tempModule.points)
|
|
||||||
|
|
||||||
let manualModule = new QPolygon(tempModule.points, { ...moduleOptions })
|
let manualModule = new QPolygon(tempModule.points, { ...moduleOptions })
|
||||||
canvas?.add(manualModule)
|
canvas?.add(manualModule)
|
||||||
manualDrawModules.push(tempModule)
|
manualDrawModules.push(tempModule)
|
||||||
@ -2234,8 +2232,8 @@ export function useModuleBasicSetting() {
|
|||||||
let isDisjoint = checkModuleDisjointObjects(module.turfPoints, containsBatchObjects)
|
let isDisjoint = checkModuleDisjointObjects(module.turfPoints, containsBatchObjects)
|
||||||
|
|
||||||
if (!(disjointFromTrestle && isDisjoint)) {
|
if (!(disjointFromTrestle && isDisjoint)) {
|
||||||
canvas?.remove(module)
|
// canvas?.remove(module)
|
||||||
// module.set({ fill: 'rgba(255,190,41, 0.4)', stroke: 'black', strokeWidth: 1 })
|
module.set({ fill: 'rgba(255,190,41, 0.4)', stroke: 'black', strokeWidth: 1 })
|
||||||
return false
|
return false
|
||||||
} else {
|
} else {
|
||||||
return module
|
return module
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user