lib/shoes/swt/text_block/fitter.rb in shoes-swt-4.0.0.pre6 vs lib/shoes/swt/text_block/fitter.rb in shoes-swt-4.0.0.pre7

- old
+ new

@@ -93,13 +93,11 @@ generate_two_layouts(first_layout, first_text, second_text, height) end end def fit_as_empty_first_layout(height) - if height == :unbounded || height == 0 - return [] - end + return [] if height == :unbounded || height.zero? height += ::Shoes::Slot::NEXT_ELEMENT_OFFSET generate_two_layouts(empty_segment, "", @dsl.text, height) end @@ -110,10 +108,11 @@ else position_two_segments( empty_segment, CenteredTextSegment.new(@dsl, @dsl.containing_width), "", - height) + height + ) end end def first_element_on_line? @dsl.left - @dsl.margin_left <= 0