Explorar o código

修改文件夹对应的球半径,缩小为原来的1/2

zhong (钟鹏群) hai 1 mes
pai
achega
bdd344c079
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      ball-demo.py

+ 2 - 2
ball-demo.py

@@ -461,9 +461,9 @@ while running:
         glTranslatef(x, y, z)
         quad = gluNewQuadric()
         gluQuadricNormals(quad, GLU_SMOOTH)
-        # 根据深度和节点类型调整球体大小:深度越大,球体越小;文件节点的半径缩小为原来的1/3
+        # 根据深度和节点类型调整球体大小:深度越大,球体越小;文件节点的半径缩小为原来的1/3,文件夹节点的半径缩小为原来的1/2
         if is_dir:
-            current_radius = ball_radius * (0.85 ** depth)  # 文件夹节点使用默认半径
+            current_radius = (ball_radius / 2) * (0.85 ** depth)  # 文件夹节点的半径缩小为原来的1/2
         else:
             current_radius = (ball_radius / 3) * (0.85 ** depth)  # 文件节点的半径缩小为原来的1/3
         gluSphere(quad, current_radius, 32, 32)