fixed close button not working
This commit is contained in:
parent
0f63e5bbe6
commit
20aaa98c23
@ -1 +0,0 @@
|
||||
from .cellular_automaton import *
|
@ -86,7 +86,6 @@ class CAWindow:
|
||||
running = True
|
||||
|
||||
while running:
|
||||
pygame.event.get()
|
||||
time_ca_start = time.time()
|
||||
self._ca.evolve_x_times(evolution_steps_per_draw)
|
||||
time_ca_end = time.time()
|
||||
@ -94,6 +93,10 @@ class CAWindow:
|
||||
time_ds_end = time.time()
|
||||
self.__print_process_duration(time_ca_end, time_ca_start, time_ds_end)
|
||||
|
||||
for event in pygame.event.get():
|
||||
if event.type == pygame.QUIT:
|
||||
running = False
|
||||
|
||||
def __print_process_duration(self, time_ca_end, time_ca_start, time_ds_end):
|
||||
self._screen.fill([0, 0, 0], ((0, 0), (self.__window_size[0], 30)))
|
||||
self.__write_text((10, 5), "CA: " + "{0:.4f}".format(time_ca_end - time_ca_start) + "s")
|
||||
|
Loading…
Reference in New Issue
Block a user