Sha256: a710ccfb2679ca10f6ca430fd78934b130dd9a6c631637eab73bf81212790369

Contents?: true

Size: 501 Bytes

Versions: 4

Compression:

Stored size: 501 Bytes

Contents

# frozen_string_literal: true

module Gruff
  # @private
  class Renderer::Rectangle
    def initialize(renderer, color: nil)
      @renderer = renderer
      @color = color
    end

    def render(upper_left_x, upper_left_y, lower_right_x, lower_right_y)
      @renderer.draw.push
      @renderer.draw.stroke('transparent')
      @renderer.draw.fill(@color) if @color
      @renderer.draw.rectangle(upper_left_x, upper_left_y, lower_right_x, lower_right_y)
      @renderer.draw.pop
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gruff-0.15.0-java lib/gruff/renderer/rectangle.rb
gruff-0.15.0 lib/gruff/renderer/rectangle.rb
gruff-0.14.0 lib/gruff/renderer/rectangle.rb
gruff-0.14.0-java lib/gruff/renderer/rectangle.rb