lib/thinreports/generator/pdf/document/graphics/text.rb in thinreports-0.10.1 vs lib/thinreports/generator/pdf/document/graphics/text.rb in thinreports-0.10.2
- old
+ new
@@ -38,11 +38,10 @@
pdf.formatted_text_box(
[{ text: content, styles: font_styles }],
built_attrs.merge(box_attrs)
)
end
- # rubocop:disable Lint/HandleExceptions
rescue Prawn::Errors::CannotFit
# Nothing to do.
#
# When the area is too small compared
# with the content and the style of the text.
@@ -79,11 +78,10 @@
# @param attrs (see #text)
# @yield [built_attrs, font_styles]
# @yieldparam [Hash] built_attrs The finalized attributes.
# @yieldparam [Array] font_styles The finalized styles.
- # rubocop:disable Metrics/AbcSize
def with_text_styles(attrs, &block)
# When no color is given, do not draw.
return unless attrs.key?(:color) && attrs[:color] != 'none'
save_graphics_state
@@ -137,10 +135,9 @@
# @option font [Numeric] :size
# @option font [String] :name
# @yield [attributes, styles]
# @yieldparam [Hash] modified_attrs
# @yieldparam [Array] styles
- # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
def with_font_styles(attrs, font, &block)
# Building font styles.
styles = attrs.delete(:styles)
if styles