File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,18 +104,20 @@ module UIng
104104 fill_brush : Brush ? = nil ,
105105 stroke_brush : Brush ? = nil ,
106106 stroke_params : StrokeParams ? = nil , & )
107- if fill && fill_brush.nil?
108- raise ArgumentError .new(" fill=true requires fill_brush" )
109- end
110- if stroke && (stroke_brush.nil? || stroke_params.nil?)
111- raise ArgumentError .new(" stroke=true requires stroke_brush and stroke_params" )
112- end
113-
114107 Path .open(mode) do |path |
115108 yield path
116109 path.end_path
117- self .draw_fill(path, fill_brush.not_nil!) if fill
118- self .draw_stroke(path, stroke_brush.not_nil!, stroke_params.not_nil!) if stroke
110+
111+ if fill
112+ brush = fill_brush || raise ArgumentError .new(" fill=true requires fill_brush" )
113+ draw_fill(path, brush)
114+ end
115+
116+ if stroke
117+ brush = stroke_brush || raise ArgumentError .new(" stroke=true requires stroke_brush and stroke_params" )
118+ params = stroke_params || raise ArgumentError .new(" stroke=true requires stroke_brush and stroke_params" )
119+ draw_stroke(path, brush, params)
120+ end
119121 end
120122 end
121123
You can’t perform that action at this time.
0 commit comments