Merge pull request 'dev' (#624) from dev into dev-deploy
Reviewed-on: #624
This commit is contained in:
commit
44b0001848
@ -859,7 +859,7 @@ const Trestle = forwardRef((props, ref) => {
|
|||||||
type="checkbox"
|
type="checkbox"
|
||||||
id={`ch01`}
|
id={`ch01`}
|
||||||
disabled={!cvrYn || cvrYn === 'N'}
|
disabled={!cvrYn || cvrYn === 'N'}
|
||||||
checked={cvrChecked || true}
|
checked={cvrChecked ?? false}
|
||||||
// onChange={() => dispatch({ type: 'SET_TRESTLE_DETAIL', roof: { ...trestleState, cvrChecked: !trestleState.cvrChecked } })}
|
// onChange={() => dispatch({ type: 'SET_TRESTLE_DETAIL', roof: { ...trestleState, cvrChecked: !trestleState.cvrChecked } })}
|
||||||
onChange={() => setCvrChecked(!cvrChecked)}
|
onChange={() => setCvrChecked(!cvrChecked)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -58,7 +58,12 @@ export function useImgLoader() {
|
|||||||
canvas.renderAll()
|
canvas.renderAll()
|
||||||
|
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
const dataUrl = canvas.toDataURL('image/png')
|
// 고해상도 캡처를 위해 multiplier 옵션 추가 (2배 해상도)
|
||||||
|
const multiplier = 2
|
||||||
|
const dataUrl = canvas.toDataURL({
|
||||||
|
format: 'png',
|
||||||
|
multiplier: multiplier,
|
||||||
|
})
|
||||||
const blobBin = atob(dataUrl.split(',')[1])
|
const blobBin = atob(dataUrl.split(',')[1])
|
||||||
const array = []
|
const array = []
|
||||||
for (let i = 0; i < blobBin.length; i++) {
|
for (let i = 0; i < blobBin.length; i++) {
|
||||||
@ -69,13 +74,13 @@ export function useImgLoader() {
|
|||||||
formData.append('objectNo', currentCanvasPlan.objectNo)
|
formData.append('objectNo', currentCanvasPlan.objectNo)
|
||||||
formData.append('planNo', currentCanvasPlan.planNo)
|
formData.append('planNo', currentCanvasPlan.planNo)
|
||||||
formData.append('type', type)
|
formData.append('type', type)
|
||||||
/** 이미지 크롭 좌표 계산 */
|
/** 이미지 크롭 좌표 계산 (multiplier 배율 적용) */
|
||||||
const positionObj = getImageCoordinates()
|
const positionObj = getImageCoordinates()
|
||||||
console.log('🚀 ~ handleCanvasToPng ~ positionObj:', positionObj)
|
console.log('🚀 ~ handleCanvasToPng ~ positionObj:', positionObj)
|
||||||
formData.append('width', Math.round(positionObj[1].x - positionObj[0].x + 100))
|
formData.append('width', Math.round((positionObj[1].x - positionObj[0].x + 100) * multiplier))
|
||||||
formData.append('height', Math.round(positionObj[1].y - positionObj[0].y + 100))
|
formData.append('height', Math.round((positionObj[1].y - positionObj[0].y + 100) * multiplier))
|
||||||
formData.append('left', Math.round(positionObj[0].x))
|
formData.append('left', Math.round(positionObj[0].x * multiplier))
|
||||||
formData.append('top', Math.round(positionObj[0].y))
|
formData.append('top', Math.round(positionObj[0].y * multiplier))
|
||||||
console.log('🚀 ~ handleCanvasToPng ~ formData:', formData)
|
console.log('🚀 ~ handleCanvasToPng ~ formData:', formData)
|
||||||
|
|
||||||
/** 이미지 크롭 요청 */
|
/** 이미지 크롭 요청 */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user