Sha256: cee01c309df6f11a7840cff645cb043c08a230e62f657f304f9b2530e2cb5fe7

Contents?: true

Size: 535 Bytes

Versions: 10

Compression:

Stored size: 535 Bytes

Contents

# frozen_string_literal: true

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

    def render(points)
      @renderer.draw.push
      @renderer.draw.stroke_width(@width)
      @renderer.draw.stroke(@color)
      @renderer.draw.fill(@color)
      @renderer.draw.fill_opacity(@opacity)
      @renderer.draw.polygon(*points)
      @renderer.draw.pop
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
gruff-0.18.0-java lib/gruff/renderer/polygon.rb
gruff-0.18.0 lib/gruff/renderer/polygon.rb
gruff-0.17.0-java lib/gruff/renderer/polygon.rb
gruff-0.17.0 lib/gruff/renderer/polygon.rb
gruff-0.16.0 lib/gruff/renderer/polygon.rb
gruff-0.16.0-java lib/gruff/renderer/polygon.rb
gruff-0.15.0-java lib/gruff/renderer/polygon.rb
gruff-0.15.0 lib/gruff/renderer/polygon.rb
gruff-0.14.0 lib/gruff/renderer/polygon.rb
gruff-0.14.0-java lib/gruff/renderer/polygon.rb