Skip to content

Commit

Permalink
コンソールのエラーメッセージ対応
Browse files Browse the repository at this point in the history
  • Loading branch information
st-func committed Apr 20, 2024
1 parent 608cc49 commit 18faa02
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
28 changes: 19 additions & 9 deletions src/DrawSection.tsx
Expand Up @@ -91,15 +91,25 @@ export const Drawing: React.FC<DrawingProps> = ({ drawingData }) => {
<svg width={drawingData.width} height={drawingData.height}>
{drawingData.lines.map((line) => {
return line.pointPairs().map(([point1, point2]) => {
return (
<line
x1={point1.x_screen}
y1={point1.y_screen}
x2={point2.x_screen}
y2={point2.y_screen}
stroke="black"
/>
);
if (
isNaN(point1.x_screen) ||
isNaN(point1.y_screen) ||
isNaN(point2.x_screen) ||
isNaN(point2.y_screen)
) {
return null;
} else {
return (
<line
x1={point1.x_screen}
y1={point1.y_screen}
x2={point2.x_screen}
y2={point2.y_screen}
stroke="black"
key={Math.random()}
/>
);
}
});
})}
</svg>
Expand Down
6 changes: 3 additions & 3 deletions src/SecProperty.tsx
Expand Up @@ -25,7 +25,7 @@ const ResultTable: React.FC<CalcDataProps> = ({ calcDatas }) => (
<table>
<tbody>
{calcDatas.map((calcData) => (
<tr>
<tr key={calcData.symbol}>
<td>{calcData.description}</td>
<td>{calcData.symbol}</td>
<td>=</td>
Expand Down Expand Up @@ -58,8 +58,8 @@ const InputTable: React.FC<DimensionDataProps> = ({
}) => (
<table>
<tbody>
{dimensionDatas.map((dimension) => (
<tr>
{dimensionDatas.map((dimension, index) => (
<tr key={index}>
<td>{dimension.symbol}</td>
<td>:</td>
<td>
Expand Down

0 comments on commit 18faa02

Please sign in to comment.