]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Fixed TrendNode.setTrendSpec to properly update item axes 39/439/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 20 Apr 2017 10:54:20 +0000 (13:54 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 20 Apr 2017 10:54:58 +0000 (13:54 +0300)
The previous code was not counting the set axes hidden/unhidden between
successive TrendNode.setTrendSpec calls.

refs #7155

Change-Id: I7aa9d8dec76d4328d2f4d12dfd0f9523fea71f2c

bundles/org.simantics.trend/src/org/simantics/trend/impl/TrendNode.java

index 575af21f5aa77265d0ee80298ceb1e8c3eb791dd..ddbd4934e0763dd6dd82468a0031563b2ea56f5d 100644 (file)
@@ -243,7 +243,8 @@ public class TrendNode extends G2DParentNode implements TrendLayout {
                TObjectIntMap<String> 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;
        }