瀏覽代碼

HolonBody resize pulsating fix

Jessey Widhalm 7 年之前
父節點
當前提交
c8d46af25e
共有 1 個文件被更改,包括 4 次插入3 次删除
  1. 4 3
      src/ui/view/HolonCanvas.java

+ 4 - 3
src/ui/view/HolonCanvas.java

@@ -116,7 +116,8 @@ public class HolonCanvas extends JPanel implements MouseWheelListener {
 		for (int i = 0; i < subCount; i++) {
 			for (int j = 0; j < bodies.size(); j++) {
 				if (model.getSubNetColors().get(i) == bodies.get(j).getColor()) {
-					bodies.get(j).setRadius(subnets.get(i).getObjects().size() * 5 + 10);
+					bodies.get(j).setRadius(
+							(subnets.get(i).getObjects().size() * 5 + 10) * controller.getHolonBodyScale() / 100);
 					bodies.get(j).setMass(subnets.get(i).getObjects().size() * 5 + 10);
 					newBodies.add(bodies.get(j));
 					newBodies.get(i).setId(i);
@@ -128,8 +129,8 @@ public class HolonCanvas extends JPanel implements MouseWheelListener {
 		bodies = newBodies;
 		for (int i = bodies.size(); i < subCount; i++) {
 			HolonBody temp = new HolonBody((center.width + 1) + (-1 * i), (center.height + 1) + (-1 * i),
-					subnets.get(i).getObjects().size() * 5 + 10, subnets.get(i).getObjects().size() * 5 + 10,
-					model.getSubNetColors().get(i));
+					(subnets.get(i).getObjects().size() * 5 + 10) * controller.getHolonBodyScale() / 100,
+					subnets.get(i).getObjects().size() * 5 + 10, model.getSubNetColors().get(i));
 			temp.setId(i);
 			bodies.add(temp);
 		}