Sha256: 91f99c832e000a4f8e1a419bdf288b7d1216cc771b14786978132943f77769ad

Contents?: true

Size: 561 Bytes

Versions: 2

Compression:

Stored size: 561 Bytes

Contents

module Gatling
  module ImageWrangler

    def self.get_element_position element
      element = element.native
      position = Hash.new{}
      position[:x] = element.location.x
      position[:y] = element.location.y
      position[:width] = element.size.width
      position[:height] = element.size.height
      position
    end

    def self.crop_element image, element_to_crop
      position = get_element_position(element_to_crop)
      @cropped_element = image.crop(position[:x], position[:y], position[:width], position[:height])
    end




  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gatling-1.0.9 lib/gatling/image_wrangler.rb
gatling-1.0.8 lib/gatling/image_wrangler.rb