允许返回空

This commit is contained in:
ChenX 2024-03-29 17:47:00 +08:00
parent bdb033f410
commit bfa2feca5b
5 changed files with 7 additions and 3 deletions

View File

@ -23220,6 +23220,8 @@ function ParseRegionTextPos(contour, holes, textBox = TEXT_BOX, allowReturnNullP
let path = new Path(contour); let path = new Path(contour);
let nfps = path.GetInsideNFP(textBox)?.map(nfp => Path2Polyline(PathTranslate_Self(PathScale(nfp, 1e-4), path.OrigionMinPoint.x, path.OrigionMinPoint.y))); //可能无法获得 let nfps = path.GetInsideNFP(textBox)?.map(nfp => Path2Polyline(PathTranslate_Self(PathScale(nfp, 1e-4), path.OrigionMinPoint.x, path.OrigionMinPoint.y))); //可能无法获得
if (!nfps || nfps.length === 0) { if (!nfps || nfps.length === 0) {
if (allowReturnNullPos)
return;
nfps = [Path2Polyline(contour)]; nfps = [Path2Polyline(contour)];
hasTextBox = false; hasTextBox = false;
} }

File diff suppressed because one or more lines are too long

View File

@ -23193,6 +23193,8 @@ function ParseRegionTextPos(contour, holes, textBox = TEXT_BOX, allowReturnNullP
let path = new Path(contour); let path = new Path(contour);
let nfps = path.GetInsideNFP(textBox)?.map(nfp => Path2Polyline(PathTranslate_Self(PathScale(nfp, 1e-4), path.OrigionMinPoint.x, path.OrigionMinPoint.y))); //可能无法获得 let nfps = path.GetInsideNFP(textBox)?.map(nfp => Path2Polyline(PathTranslate_Self(PathScale(nfp, 1e-4), path.OrigionMinPoint.x, path.OrigionMinPoint.y))); //可能无法获得
if (!nfps || nfps.length === 0) { if (!nfps || nfps.length === 0) {
if (allowReturnNullPos)
return;
nfps = [Path2Polyline(contour)]; nfps = [Path2Polyline(contour)];
hasTextBox = false; hasTextBox = false;
} }

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
{"version":3,"file":"ParseRegionTextPos.d.ts","sourceRoot":"","sources":["../../../../../src/DatabaseServices/Room/ParseService/ParseRegionTextPos.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAInD,OAAO,EAAE,IAAI,EAAiC,MAAM,yBAAyB,CAAC;AAQ9E;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,OAAO,OAAW,EAAE,kBAAkB,UAAQ,GAAG,OAAO,GAAG,SAAS,CA2G5I"} {"version":3,"file":"ParseRegionTextPos.d.ts","sourceRoot":"","sources":["../../../../../src/DatabaseServices/Room/ParseService/ParseRegionTextPos.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAInD,OAAO,EAAE,IAAI,EAAiC,MAAM,yBAAyB,CAAC;AAQ9E;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,OAAO,OAAW,EAAE,kBAAkB,UAAQ,GAAG,OAAO,GAAG,SAAS,CA6G5I"}