fix(editor): сохранять позицию кнопки при отмене Resize (#645)

Транзитная геометрия Resize теперь только вычисляет центр для текущего кадра и не удаляет сессионную позицию. Окончательная геометрия по-прежнему очищает точку, если она действительно вышла за комнату.

Issue: #645
User-Visible: yes
This commit is contained in:
Sergey Matyunin
2026-09-25 10:15:34 +03:00
parent 449438fb20
commit f293c6e9dc
75 changed files with 830 additions and 752 deletions
+13 -1
View File
@@ -12012,10 +12012,22 @@ const MUTANT_DEFINITIONS = [
+ 'rendered for the room button, not reserve the now-empty automatic centre',
patches: [{
file: 'src/houseplan-editor-runtime.ts',
find: ' ? (this.roomGear.center(room, poly, space!.id) || poleOfInaccessibility(poly))',
find: ' ? (this.roomGear.previewCenter(room, poly, space!.id) || poleOfInaccessibility(poly))',
replace: ' ? poleOfInaccessibility(poly) // mutant: ignore the moved room button',
}],
},
{
id: 'room-gear-preview-prunes-session-position',
guard: 'node --test --test-name-pattern="Resize preview cannot prune" test/room-gear-drag.test.mjs',
because: '#645 review r1 M1: a transient Resize polygon may exclude the moved room button, '
+ 'but cancelling that preview must preserve the session position that remains valid in the '
+ 'committed room geometry',
patches: [{
file: 'src/room-gear-drag.ts',
find: ' return resolveRoomGearCenter(\n room, this.positions.get(this.key(room.id, spaceId)), polygonOverride,\n ).point;',
replace: ' return this.center(room, polygonOverride, spaceId); // mutant: preview prunes state',
}],
},
];
const mutationCardSource = readFileSync(join(repoRoot, 'src/houseplan-card.ts'), 'utf8');