dev #514

Merged
ysCha merged 2 commits from dev into prd-deploy 2025-12-22 18:22:19 +09:00
4 changed files with 38 additions and 13 deletions

View File

@ -235,11 +235,23 @@ export default function Module({ setTabNum }) {
<div className="eaves-keraba-td">
<div className="outline-form">
<div className="grid-select mr10">
<input
type="text"
{/*<input*/}
{/* type="text"*/}
{/* className="input-origin block"*/}
{/* value={inputVerticalSnowCover}*/}
{/* onChange={(e) => setInputVerticalSnowCover(normalizeDecimal(e.target.value))}*/}
{/*/>*/}
<CalculatorInput
id=""
name=""
label=""
className="input-origin block"
value={inputVerticalSnowCover}
onChange={(e) => setInputVerticalSnowCover(normalizeDecimal(e.target.value))}
onChange={(value) => setInputVerticalSnowCover(value)}
options={{
allowNegative: false,
allowDecimal: false
}}
/>
</div>
<span className="thin">cm</span>

View File

@ -638,7 +638,7 @@ export const Orientation = forwardRef((props, ref) => {
name=""
label=""
className="input-origin block"
value={inputInstallHeight}
value={inputVerticalSnowCover}
onChange={(value) => handleChangeVerticalSnowCover(value)}
options={{
allowNegative: false,

View File

@ -473,7 +473,20 @@ export function useRoofAllocationSetting(id) {
// Filter out any eaveHelpLines that are already in lines to avoid duplicates
const existingEaveLineIds = new Set(roofBase.lines.map((line) => line.id))
const newEaveLines = roofEaveHelpLines.filter((line) => !existingEaveLineIds.has(line.id))
roofBase.lines = [...newEaveLines]
// Filter out lines from roofBase.lines that share any points with newEaveLines
const linesToKeep = roofBase.lines.filter(roofLine => {
return !newEaveLines.some(eaveLine => {
// Check if any endpoint of roofLine matches any endpoint of eaveLine
return (
// Check if any endpoint of roofLine matches any endpoint of eaveLine
(Math.abs(roofLine.x1 - eaveLine.x1) < 0.1 && Math.abs(roofLine.y1 - eaveLine.y1) < 0.1) || // p1 matches p1
(Math.abs(roofLine.x2 - eaveLine.x2) < 0.1 && Math.abs(roofLine.y2 - eaveLine.y2) < 0.1) // p2 matches p2
);
});
});
// Combine remaining lines with newEaveLines
roofBase.lines = [...linesToKeep, ...newEaveLines];
} else {
roofBase.lines = [...roofEaveHelpLines]
}

View File

@ -844,7 +844,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
const prevIndex = (index - 1 + sortRoofLines.length) % sortRoofLines.length
const nextIndex = (index + 1) % sortRoofLines.length
const newLine = sortRoofLines[prevIndex]
const newLine = sortRoofLines[nextIndex]
if (Math.abs(wallBaseLine.y1 - wallLine.y1) < 0.1) {
if (inLine) {
@ -898,7 +898,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
const prevIndex = (index - 1 + sortRoofLines.length) % sortRoofLines.length;
const nextIndex = (index + 1) % sortRoofLines.length;
const newLine = sortRoofLines[nextIndex]
const newLine = sortRoofLines[prevIndex]
if (Math.abs(wallBaseLine.y2 - wallLine.y2) < 0.1) {
@ -1014,7 +1014,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
const prevIndex = (index - 1 + sortRoofLines.length) % sortRoofLines.length
const nextIndex = (index + 1) % sortRoofLines.length
const newLine = sortRoofLines[prevIndex]
const newLine = sortRoofLines[nextIndex]
if (Math.abs(wallBaseLine.y1 - wallLine.y1) < 0.1) {
if (inLine) {
@ -1068,7 +1068,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
const prevIndex = (index - 1 + sortRoofLines.length) % sortRoofLines.length;
const nextIndex = (index + 1) % sortRoofLines.length;
const newLine = sortRoofLines[nextIndex]
const newLine = sortRoofLines[prevIndex]
if (inLine) {
if (inLine.x2 < inLine.x1) {
@ -1203,7 +1203,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
const prevIndex = (index - 1 + sortRoofLines.length) % sortRoofLines.length;
const nextIndex = (index + 1) % sortRoofLines.length;
const newLine = sortRoofLines[prevIndex]
const newLine = sortRoofLines[nextIndex]
if (Math.abs(wallBaseLine.x1 - wallLine.x1) < 0.1) {
if (inLine) {
@ -1255,7 +1255,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
const prevIndex = (index - 1 + sortRoofLines.length) % sortRoofLines.length;
const nextIndex = (index + 1) % sortRoofLines.length;
const newLine = sortRoofLines[nextIndex]
const newLine = sortRoofLines[prevIndex]
if (Math.abs(wallBaseLine.x2 - wallLine.x2) < 0.1) {
if (inLine) {
@ -1365,7 +1365,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
const prevIndex = (index - 1 + sortRoofLines.length) % sortRoofLines.length;
const nextIndex = (index + 1) % sortRoofLines.length;
const newLine = sortRoofLines[prevIndex]
const newLine = sortRoofLines[nextIndex]
if (Math.abs(wallBaseLine.x1 - wallLine.x1) < 0.1) {
if (inLine) {
@ -1419,7 +1419,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
const prevIndex = (index - 1 + sortRoofLines.length) % sortRoofLines.length;
const nextIndex = (index + 1) % sortRoofLines.length;
const newLine = sortRoofLines[nextIndex]
const newLine = sortRoofLines[prevIndex]
if (Math.abs(wallBaseLine.x2 - wallLine.x2) < 0.1) {
if (inLine) {