button.rb
# Measure the button text and make the overall button size twice the height
# and about four letters more than the width.
Measure the button text and make the overall button size twice the height
and about four letters more than the width.
Measure the button text and make the overall button size twice the height and about four letters more than the width .
def measure_size
      @text_size  = @font.measure(@text)
      width       = @text_size.width
      ave_width   = width / @text.size
      @size = Size.new(width + 4 * ave_width, @text_size.height * 2)
    end
def measure_size @text_size = @font . measure ( @text ) width = @text_size . width ave_width = width / @text . size @size = Size . new ( width + 4 * ave_width , @text_size . height * 2 ) end
Measure the button text and make the overall button size twice the height
and about four letters more than the width.
Measure the button text and make the overall button size twice the height and about four letters more than the width .