lib/thinreports/generator/pdf/document/draw_shape.rb in thinreports-0.7.6 vs lib/thinreports/generator/pdf/document/draw_shape.rb in thinreports-0.7.7

- old
+ new

@@ -18,10 +18,17 @@ attrs[:single] = true end text_box(content, x, y, w, h, attrs) end end + + def draw_shape_pageno(shape, page_no, page_count) + x, y, w, h = shape.box.values_at('x', 'y', 'width', 'height') + + text_box(shape.build_format(page_no, page_count), x, y, w, h, + common_text_attrs(shape.style.svg_attrs)) + end # @param [ThinReports::Core::Shape::Basic::Internal] shape def draw_shape_image(shape) x, y, w, h = shape.style.svg_attrs.values_at('x', 'y', 'width', 'height') base64image(extract_base64_string(shape.style.svg_attrs['xlink:href']), @@ -81,15 +88,18 @@ common_text_attrs(shape.style.svg_attrs) do |attrs| # Set the :line_height option. attrs[:line_height] = format.line_height unless format.line_height.blank? # Set the :valign option. attrs[:valign] = shape.style.valign - - # Set the :overflow option. - attrs[:overflow] = text_overflow(format.overflow) if shape.type_of?(:tblock) + + if shape.type_of?(:tblock) + # Set the :overflow option. + attrs[:overflow] = text_overflow(format.overflow) + # Set the :word_wrap option + attrs[:word_wrap] = text_word_wrap(format.word_wrap) + end end end - end end end