From: Tuukka Lehtonen Date: Thu, 20 Apr 2017 10:54:20 +0000 (+0300) Subject: Fixed TrendNode.setTrendSpec to properly update item axes X-Git-Tag: v1.28.0~20 X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=commitdiff_plain;h=6cc8c195e9ba9cfc683aca657c23b23cadda73ae Fixed TrendNode.setTrendSpec to properly update item axes The previous code was not counting the set axes hidden/unhidden between successive TrendNode.setTrendSpec calls. refs #7155 Change-Id: I7aa9d8dec76d4328d2f4d12dfd0f9523fea71f2c --- diff --git a/bundles/org.simantics.trend/src/org/simantics/trend/impl/TrendNode.java b/bundles/org.simantics.trend/src/org/simantics/trend/impl/TrendNode.java index 575af21f5..ddbd4934e 100644 --- a/bundles/org.simantics.trend/src/org/simantics/trend/impl/TrendNode.java +++ b/bundles/org.simantics.trend/src/org/simantics/trend/impl/TrendNode.java @@ -243,7 +243,8 @@ public class TrendNode extends G2DParentNode implements TrendLayout { TObjectIntMap map = new TObjectIntHashMap<>(items.size(), 0.5f, -1); for (int i = 0; i < items.size(); ++i) { TrendItem it = items.get(i); - map.put(it.groupItemId, i); + if (!it.hidden) + map.put(it.groupItemId, i); } return map; }