Skip to content

Commit 5ee22e3

Browse files
committed
Create Size.zero to keep things simple
1 parent 36d88ff commit 5ee22e3

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

examples/menu/menu.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def listen
3434

3535
# this tells the Viewport to draw to the screen
3636
def draw
37-
@viewport.draw content, Size([0,0]), header, footer
37+
@viewport.draw content, Size.zero, header, footer
3838
end
3939

4040
# this is the body of our menu, it will be squished if the terminal is too small

lib/remedy/size.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ def initialize *new_dimensions
1111
end
1212
attr_accessor :dimensions
1313

14+
def self.zero
15+
self.new([0,0])
16+
end
17+
1418
def - other_size
1519
if other_size.respond_to? :length then
1620
self.class.new subtract(other_size)

0 commit comments

Comments
 (0)