diff options
author | Logan Hunt <logan.hunt@usu.edu> | 2023-01-04 15:22:28 -0700 |
---|---|---|
committer | Logan Hunt <logan.hunt@usu.edu> | 2023-01-04 15:22:28 -0700 |
commit | 1536d0192f9bb0490d64d58b4da22d12076a25af (patch) | |
tree | 5cc09ab0fa621efeb8a36c317eb5e53103846f18 /lib/chessh/ssh/screens/screen.ex | |
parent | 93ae544684b29db30c6c65a5ba5e7cb51972123c (diff) | |
download | chessh-1536d0192f9bb0490d64d58b4da22d12076a25af.tar.gz chessh-1536d0192f9bb0490d64d58b4da22d12076a25af.zip |
Move to a new state when menu option selected
Diffstat (limited to 'lib/chessh/ssh/screens/screen.ex')
-rw-r--r-- | lib/chessh/ssh/screens/screen.ex | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/chessh/ssh/screens/screen.ex b/lib/chessh/ssh/screens/screen.ex index be6e00e..3d9e9ec 100644 --- a/lib/chessh/ssh/screens/screen.ex +++ b/lib/chessh/ssh/screens/screen.ex @@ -10,6 +10,13 @@ defmodule Chessh.SSH.Client.Screen do @ascii_chars Application.compile_env!(:chessh, :ascii_chars_json_file) |> File.read!() |> Jason.decode!() + + def center_rect({rect_width, rect_height}, {parent_width, parent_height}) do + { + div(parent_height - rect_height, 2), + div(parent_width - rect_width, 2) + } + end end end end |