lib/rubyXL/convenience_methods.rb in rubyXL-3.3.23 vs lib/rubyXL/convenience_methods.rb in rubyXL-3.3.24
- old
+ new
@@ -166,9 +166,13 @@
end
def modify_border(style_index, direction, weight)
xf = cell_xfs[style_index || 0].dup
new_border = borders[xf.border_id || 0].dup
+
+ edge = new_border.send(direction)
+ new_border.send("#{direction}=", edge.dup) if edge
+
new_border.set_edge_style(direction, weight)
xf.border_id = borders.find_index { |x| x == new_border } # Reuse existing border, if it exists
xf.border_id ||= borders.size # If this border has never existed before, add it to collection.
borders[xf.border_id] = new_border