fix: preserve furniture component when clipping protected people

This commit is contained in:
134 2026-07-04 19:18:23 +08:00
parent 19c4367fb8
commit 2ae5ceb234

View File

@ -1698,8 +1698,6 @@ function filterScaleAdjustStructureComponents(params: {
: protectedPersonSide === "auto" : protectedPersonSide === "auto"
? touchesLeft || touchesRight ? touchesLeft || touchesRight
: false; : false;
const protectedPersonOverlapRatio =
protectedPersonOverlap / Math.max(1, area);
const shouldClipProtectedPersonSide = const shouldClipProtectedPersonSide =
Boolean(protectedPersonMask) && Boolean(protectedPersonMask) &&
protectedPersonOverlap > 0 && protectedPersonOverlap > 0 &&
@ -1718,11 +1716,6 @@ function filterScaleAdjustStructureComponents(params: {
} }
return false; return false;
}; };
const likelyProtectedPersonComponent =
Boolean(protectedPersonMask) &&
protectedPersonOverlap > 0 &&
touchesProtectedPersonSide &&
protectedPersonOverlapRatio >= 0.32;
const broadTopBackground = const broadTopBackground =
touchesTop && touchesTop &&
centerYRatio <= 0.45 && centerYRatio <= 0.45 &&
@ -1748,8 +1741,7 @@ function filterScaleAdjustStructureComponents(params: {
likelyStructure && likelyStructure &&
centeredEnough && centeredEnough &&
!edgeSliver && !edgeSliver &&
!broadTopBackground && !broadTopBackground
!likelyProtectedPersonComponent
) { ) {
if (fillSurfaceComponent) { if (fillSurfaceComponent) {
for (let fillY = minY; fillY <= maxY; fillY += 1) { for (let fillY = minY; fillY <= maxY; fillY += 1) {