Sha256: b8c0d9e627aac383c5d960b6f288583fa0ab0b366021b021de37113404c4b8c4

Contents?: true

Size: 444 Bytes

Versions: 6

Compression:

Stored size: 444 Bytes

Contents

# frozen_string_literal: true

module Gruff
  class Renderer::Rectangle
    def initialize(args = {})
      @color = args[:color]
    end

    def render(upper_left_x, upper_left_y, lower_right_x, lower_right_y)
      draw = Renderer.instance.draw

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gruff-0.11.0 lib/gruff/renderer/rectangle.rb
gruff-0.11.0-java lib/gruff/renderer/rectangle.rb
gruff-0.10.0 lib/gruff/renderer/rectangle.rb
gruff-0.10.0-java lib/gruff/renderer/rectangle.rb
gruff-0.9.0 lib/gruff/renderer/rectangle.rb
gruff-0.9.0-java lib/gruff/renderer/rectangle.rb