Skip to content

Commit 62aabed

Browse files
author
zhaokai
committed
dimModal数据不对应问题
1 parent 0b1f681 commit 62aabed

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/service/PlotBase/SvgLoader/element/DimModal.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Point from '../../../PlotUtilBase/Geometry/Point';
44
* @Author: zk
55
* @Date: 2021-11-16 11:04:30
66
* @LastEditors: zk
7-
* @LastEditTime: 2022-05-23 13:37:11
7+
* @LastEditTime: 2022-05-24 16:33:39
88
*/
99
export default class DimModal {
1010
constructor(element) {
@@ -41,9 +41,8 @@ export default class DimModal {
4141
get(i) {
4242
const oLen = this.translatePoints.length;
4343
const lLen = this.lineAngles.length;
44-
45-
46-
if (i >= oLen || i >= lLen) {
44+
let fIndex=i
45+
if (oLen===0 || 0 === lLen) {
4746
return undefined
4847
}
4948

@@ -66,9 +65,13 @@ export default class DimModal {
6665
});
6766
}
6867

68+
if(lLen===1 || oLen===1){
69+
fIndex=0
70+
}
71+
6972
return {
70-
originPnt: this.translatePnts[i],
71-
lineAngle: this.lineAngles[i]
73+
originPnt: this.translatePnts[fIndex],
74+
lineAngle: this.lineAngles[fIndex]
7275
};
7376
}
7477
}

0 commit comments

Comments
 (0)