Set the line style.
(mut self, style: LineStyle)
| 74 | |
| 75 | /// Set the line style. |
| 76 | pub fn with_style(mut self, style: LineStyle) -> Self { |
| 77 | let old_width = self.line_style.width; |
| 78 | let preserve_width = style.width == LineStyle::default().width; |
| 79 | self.line_style = style; |
| 80 | if preserve_width { |
| 81 | self.line_style.width = old_width; |
| 82 | } |
| 83 | self |
| 84 | } |
| 85 | |
| 86 | /// Set only the line type while preserving the current width. |
| 87 | pub fn with_line_type(mut self, line_type: LineType) -> Self { |
no outgoing calls
no test coverage detected