From 3ddf9c8c2f509bd5a326127d12a00818fe21e532 Mon Sep 17 00:00:00 2001 From: JannisX11 Date: Wed, 20 Mar 2024 20:31:13 +0100 Subject: [PATCH] Fix mirror modeling counting meshes with 1e-15 X origin as off-center --- js/modeling/mirror_modeling.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/modeling/mirror_modeling.js b/js/modeling/mirror_modeling.js index e2851507..c39be948 100644 --- a/js/modeling/mirror_modeling.js +++ b/js/modeling/mirror_modeling.js @@ -2,8 +2,8 @@ const MirrorModeling = { initial_transformer_position: 0, isCentered(element) { let center = Format.centered_grid ? 0 : 8; - if (!element.to && element.origin[0] != center) return false; - if (element.rotation[1] || element.rotation[2]) return false; + if (!element.to && Math.roundTo(element.origin[0], 3) != center) return false; + if (Math.roundTo(element.rotation[1], 3) || Math.roundTo(element.rotation[2], 3)) return false; if (element instanceof Cube && !Math.epsilon(element.to[0], MirrorModeling.flipCoord(element.from[0]), 0.01)) return false; let checkParent = (parent) => {