Sha256: ecfa9d29f862f68b05c5fa339380ae43f545fdb45d8a4e2deffea2c24c2905c5

Contents?: true

Size: 592 Bytes

Versions: 12

Compression:

Stored size: 592 Bytes

Contents

# frozen_string_literal: true

module Gruff
  # @private
  class Renderer::Circle
    def initialize(renderer, color:, width: 1.0, opacity: 1.0)
      @renderer = renderer
      @color = color
      @width = width
      @opacity = opacity
    end

    def render(origin_x, origin_y, perim_x, perim_y)
      @renderer.draw.push
      @renderer.draw.stroke_width(@width)
      @renderer.draw.stroke(@color)
      @renderer.draw.fill_opacity(@opacity)
      @renderer.draw.fill(@color)
      @renderer.draw.circle(origin_x, origin_y, perim_x, perim_y)
      @renderer.draw.pop
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
gruff-0.24.0-java lib/gruff/renderer/circle.rb
gruff-0.24.0 lib/gruff/renderer/circle.rb
gruff-0.23.0 lib/gruff/renderer/circle.rb
gruff-0.23.0-java lib/gruff/renderer/circle.rb
gruff-0.22.0 lib/gruff/renderer/circle.rb
gruff-0.22.0-java lib/gruff/renderer/circle.rb
gruff-0.21.0-java lib/gruff/renderer/circle.rb
gruff-0.21.0 lib/gruff/renderer/circle.rb
gruff-0.20.0-java lib/gruff/renderer/circle.rb
gruff-0.20.0 lib/gruff/renderer/circle.rb
gruff-0.19.0 lib/gruff/renderer/circle.rb
gruff-0.19.0-java lib/gruff/renderer/circle.rb