Skip to content

Commit

Permalink
Refactor Renderer::Dot method visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Watson1978 committed Apr 9, 2024
1 parent 2f8d5cf commit f69c66e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/gruff/renderer/dot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Gruff
class Renderer::Dot
def initialize(renderer, style, color:, width: 1.0, opacity: 1.0)
@renderer = renderer
@style = style
@style = style.to_sym
@color = color
@width = width
@opacity = opacity
Expand All @@ -17,7 +17,7 @@ def render(new_x, new_y, radius)
@renderer.draw.stroke(@color)
@renderer.draw.fill_opacity(@opacity)
@renderer.draw.fill(@color)
case @style.to_sym
case @style
when :square
square(new_x, new_y, radius)
when :diamond
Expand All @@ -28,6 +28,8 @@ def render(new_x, new_y, radius)
@renderer.draw.pop
end

private

def circle(new_x, new_y, radius)
@renderer.draw.circle(new_x, new_y, new_x - radius, new_y)
end
Expand Down

0 comments on commit f69c66e

Please sign in to comment.