From ce135a1e50d12bf80081d06cd3c7a4b8007e6b86 Mon Sep 17 00:00:00 2001 From: xeolabs Date: Tue, 5 Nov 2024 10:21:11 +0100 Subject: [PATCH] [FIX] Fix IfcBuildingStorey elevation sort --- src/plugins/StoreyViewsPlugin/StoreyViewsPlugin.js | 4 ++-- src/plugins/TreeViewPlugin/TreeViewPlugin.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/StoreyViewsPlugin/StoreyViewsPlugin.js b/src/plugins/StoreyViewsPlugin/StoreyViewsPlugin.js index c3539c923..c651ff945 100644 --- a/src/plugins/StoreyViewsPlugin/StoreyViewsPlugin.js +++ b/src/plugins/StoreyViewsPlugin/StoreyViewsPlugin.js @@ -845,8 +845,8 @@ class StoreyViewsPlugin extends Plugin { if (storey1MetaObject && (storey1MetaObject.attributes && storey1MetaObject.attributes.elevation !== undefined) && storey2MetaObject && (storey2MetaObject.attributes && storey2MetaObject.attributes.elevation !== undefined)) { - const elevation1 = storey1MetaObject.attributes.elevation; - const elevation2 = storey2MetaObject.attributes.elevation; + const elevation1 = Number.parseFloat(storey1MetaObject.attributes.elevation); + const elevation2 = Number.parseFloat(storey2MetaObject.attributes.elevation); if (elevation1 > elevation2) { return -1; } diff --git a/src/plugins/TreeViewPlugin/TreeViewPlugin.js b/src/plugins/TreeViewPlugin/TreeViewPlugin.js index 55cb3248c..da649b44b 100644 --- a/src/plugins/TreeViewPlugin/TreeViewPlugin.js +++ b/src/plugins/TreeViewPlugin/TreeViewPlugin.js @@ -1235,8 +1235,8 @@ export class TreeViewPlugin extends Plugin { if (storey1MetaObject && (storey1MetaObject.attributes && storey1MetaObject.attributes.elevation !== undefined) && storey2MetaObject && (storey2MetaObject.attributes && storey2MetaObject.attributes.elevation !== undefined)) { - const elevation1 = storey1MetaObject.attributes.elevation; - const elevation2 = storey2MetaObject.attributes.elevation; + const elevation1 = Number.parseFloat(storey1MetaObject.attributes.elevation); + const elevation2 = Number.parseFloat(storey2MetaObject.attributes.elevation); if (elevation1 > elevation2) { return -1; }