diff --git a/lib/prawn/svg/attributes/stroke.rb b/lib/prawn/svg/attributes/stroke.rb index 7832f09..b777a7f 100644 --- a/lib/prawn/svg/attributes/stroke.rb +++ b/lib/prawn/svg/attributes/stroke.rb @@ -1,5 +1,6 @@ module Prawn::SVG::Attributes::Stroke CAP_STYLE_TRANSLATIONS = {"butt" => :butt, "round" => :round, "square" => :projecting_square} + JOIN_STYLE_TRANSLATIONS = {"miter" => :miter, "round" => :round, "bevel" => :bevel} def parse_stroke_attributes_and_call if width_string = properties.stroke_width @@ -11,6 +12,10 @@ def parse_stroke_attributes_and_call if (linecap = properties.stroke_linecap) && linecap != 'inherit' add_call('cap_style', CAP_STYLE_TRANSLATIONS.fetch(linecap, :butt)) end + + if (linejoin = properties.stroke_linejoin) && linejoin != 'inherit' + add_call('join_style', JOIN_STYLE_TRANSLATIONS.fetch(linejoin, :miter)) + end if dasharray = properties.stroke_dasharray case dasharray diff --git a/lib/prawn/svg/elements/path.rb b/lib/prawn/svg/elements/path.rb index 9cf5129..aa73fd1 100644 --- a/lib/prawn/svg/elements/path.rb +++ b/lib/prawn/svg/elements/path.rb @@ -55,8 +55,6 @@ def parse end def apply - add_call 'join_style', :bevel - apply_commands apply_markers end diff --git a/lib/prawn/svg/properties.rb b/lib/prawn/svg/properties.rb index 1fc5422..88956df 100644 --- a/lib/prawn/svg/properties.rb +++ b/lib/prawn/svg/properties.rb @@ -34,6 +34,7 @@ class Prawn::SVG::Properties "stroke" => Config.new("none", true, %w(inherit none currentColor)), "stroke-dasharray" => Config.new("none", true, %w(inherit none)), "stroke-linecap" => Config.new("butt", true, %w(inherit butt round square), true), + "stroke-linejoin" => Config.new("miter", true, %w(inherit miter round bevel), true), "stroke-opacity" => Config.new("1", true), "stroke-width" => Config.new("1", true), "text-anchor" => Config.new("start", true, %w(inherit start middle end), true),