lib/shoes/swt/text_block.rb in shoes-swt-4.0.0.pre4 vs lib/shoes/swt/text_block.rb in shoes-swt-4.0.0.pre5
- old
+ new
@@ -92,10 +92,14 @@
end
def set_absolutes(starting_left, starting_top)
last_segment = segments.last
- @dsl.absolute_right = starting_left + last_segment.last_line_width +
+ # If we have an explicit width, use that.
+ # If not, take our trailing line's width.
+ width_to_offset = @dsl.element_width || last_segment.last_line_width
+
+ @dsl.absolute_right = starting_left + width_to_offset +
margin_right - NEXT_ELEMENT_OFFSET
@dsl.absolute_bottom = starting_top + last_segment.height +
margin_top + margin_bottom - NEXT_ELEMENT_OFFSET
end