lib/prawn/svg/document.rb in prawn-svg-0.25.1 vs lib/prawn/svg/document.rb in prawn-svg-0.25.2
- old
+ new
@@ -37,14 +37,18 @@
enable_web: options.fetch(:enable_web_requests, true),
enable_file_with_root: options[:enable_file_requests_with_root]
)
@sizing = Prawn::SVG::Calculators::DocumentSizing.new(bounds, @root.attributes)
- sizing.requested_width = options[:width]
- sizing.requested_height = options[:height]
- sizing.calculate
+ calculate_sizing(requested_width: options[:width], requested_height: options[:height])
@css_parser = CssParser::Parser.new
yield self if block_given?
+ end
+
+ def calculate_sizing(requested_width: nil, requested_height: nil)
+ sizing.requested_width = requested_width
+ sizing.requested_height = requested_height
+ sizing.calculate
end
end