lib/prawn/svg/elements/text_component.rb in prawn-svg-0.33.0 vs lib/prawn/svg/elements/text_component.rb in prawn-svg-0.34.0

- old
+ new

@@ -7,9 +7,13 @@ def parse if state.inside_clip_path raise SkipElementError, "<text> elements are not supported in clip paths" end + if state.text.nil? + raise SkipElementError, "attempted to <use> an component inside a text element, this is not supported" + end + state.text.x = (attributes['x'] || "").split(COMMA_WSP_REGEXP).collect { |n| x(n) } state.text.y = (attributes['y'] || "").split(COMMA_WSP_REGEXP).collect { |n| y(n) } state.text.dx = (attributes['dx'] || "").split(COMMA_WSP_REGEXP).collect { |n| x_pixels(n) } state.text.dy = (attributes['dy'] || "").split(COMMA_WSP_REGEXP).collect { |n| y_pixels(n) } state.text.rotation = (attributes['rotate'] || "").split(COMMA_WSP_REGEXP).collect(&:to_f)