Merge pull request 'dev' (#249) from dev into prd-deploy
Reviewed-on: #249
This commit is contained in:
commit
5f034c1652
@ -100,14 +100,11 @@ const resizeImage = async (image) => {
|
|||||||
|
|
||||||
let finalWidth = Math.round(image.bitmap.width * scale)
|
let finalWidth = Math.round(image.bitmap.width * scale)
|
||||||
let finalHeight = Math.round(image.bitmap.height * scale)
|
let finalHeight = Math.round(image.bitmap.height * scale)
|
||||||
|
|
||||||
if (scale < 0.6) {
|
|
||||||
finalWidth = targetImageWidth
|
|
||||||
finalHeight = targetImageHeight
|
|
||||||
}
|
|
||||||
|
|
||||||
// 실제 리사이즈 실행
|
if (scale >= 0.6) {
|
||||||
image.resize({ w: finalWidth, h: finalHeight })
|
// 실제 리사이즈 실행
|
||||||
|
image.resize({ w: finalWidth, h: finalHeight })
|
||||||
|
}
|
||||||
|
|
||||||
//배경 이미지를 생성
|
//배경 이미지를 생성
|
||||||
const mixedImage = new Jimp({ width: convertStandardWidth, height: convertStandardHeight, color: 0xffffffff })
|
const mixedImage = new Jimp({ width: convertStandardWidth, height: convertStandardHeight, color: 0xffffffff })
|
||||||
|
|||||||
@ -122,12 +122,46 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
canvas.set({ zoom: 1 })
|
canvas.set({ zoom: 1 })
|
||||||
canvas.viewportTransform = [1, 0, 0, 1, 0, 0]
|
canvas.viewportTransform = [1, 0, 0, 1, 0, 0]
|
||||||
|
|
||||||
let x, y
|
canvas.renderAll()
|
||||||
|
|
||||||
|
// roof polygon들의 중간점 계산
|
||||||
|
const roofPolygons = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
|
||||||
|
let x, y
|
||||||
x = canvas.width / 2
|
x = canvas.width / 2
|
||||||
y = canvas.height / 2
|
y = canvas.height / 2
|
||||||
|
|
||||||
canvas.zoomToPoint(new fabric.Point(x, y), 0.5)
|
/*if (roofPolygons.length > 0) {
|
||||||
|
let minX = Infinity,
|
||||||
|
minY = Infinity,
|
||||||
|
maxX = -Infinity,
|
||||||
|
maxY = -Infinity
|
||||||
|
|
||||||
|
roofPolygons.forEach((obj) => {
|
||||||
|
const boundingRect = obj.getBoundingRect()
|
||||||
|
minX = Math.min(minX, boundingRect.left)
|
||||||
|
minY = Math.min(minY, boundingRect.top)
|
||||||
|
maxX = Math.max(maxX, boundingRect.left + boundingRect.width)
|
||||||
|
maxY = Math.max(maxY, boundingRect.top + boundingRect.height)
|
||||||
|
})
|
||||||
|
|
||||||
|
x = (minX + maxX) / 2
|
||||||
|
y = (minY + maxY) / 2
|
||||||
|
} else {
|
||||||
|
// roof polygon이 없으면 기본 중앙점 사용
|
||||||
|
x = canvas.width / 2
|
||||||
|
y = canvas.height / 2
|
||||||
|
}
|
||||||
|
|
||||||
|
if (x > 1600) {
|
||||||
|
x = 0
|
||||||
|
y = 0
|
||||||
|
}
|
||||||
|
if (y > 1600) {
|
||||||
|
x = 0
|
||||||
|
y = 0
|
||||||
|
}*/
|
||||||
|
|
||||||
|
canvas.zoomToPoint(new fabric.Point(x, y), 0.4)
|
||||||
changeFontSize('lengthText', '28')
|
changeFontSize('lengthText', '28')
|
||||||
changeFontSize('circuitNumber', '28')
|
changeFontSize('circuitNumber', '28')
|
||||||
changeFontSize('flowText', '28')
|
changeFontSize('flowText', '28')
|
||||||
|
|||||||
@ -232,6 +232,9 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
//가대 상세 데이터 기준으로 모듈 설치 배치면 생성
|
//가대 상세 데이터 기준으로 모듈 설치 배치면 생성
|
||||||
const makeModuleInstArea = (roof, trestleDetail) => {
|
const makeModuleInstArea = (roof, trestleDetail) => {
|
||||||
//지붕 객체 반환
|
//지붕 객체 반환
|
||||||
|
if (!roof.pitch) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if (tabNum == 3) {
|
if (tabNum == 3) {
|
||||||
if (!roof) {
|
if (!roof) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user