Sha256: 4017b2ce82c0c91eeb6a7d6277a0cdb7fa3bf4bc28311ca7230b23ef5197db7d

Contents?: true

Size: 465 Bytes

Versions: 8

Compression:

Stored size: 465 Bytes

Contents

# frozen_string_literal: true

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

    def render(points)
      draw = Renderer.instance.draw

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
gruff-0.13.0 lib/gruff/renderer/polygon.rb
gruff-0.13.0-java lib/gruff/renderer/polygon.rb
gruff-0.12.2 lib/gruff/renderer/polygon.rb
gruff-0.12.2-java lib/gruff/renderer/polygon.rb
gruff-0.12.1 lib/gruff/renderer/polygon.rb
gruff-0.12.1-java lib/gruff/renderer/polygon.rb
gruff-0.12.0 lib/gruff/renderer/polygon.rb
gruff-0.12.0-java lib/gruff/renderer/polygon.rb