From 241093f3ea07255af6d36fa9e07c2a1ecb7c712f Mon Sep 17 00:00:00 2001 From: Tom Black Date: Wed, 12 Dec 2018 00:10:14 -0800 Subject: Make `contains?` inclusive (#137) If point is over the visual area, it's true. Also add default rectangle implementation to `renderable.rb`. --- test/image_spec.rb | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'test/image_spec.rb') diff --git a/test/image_spec.rb b/test/image_spec.rb index e2ef37e..7d4f96d 100644 --- a/test/image_spec.rb +++ b/test/image_spec.rb @@ -8,19 +8,4 @@ RSpec.describe Ruby2D::Image do end end - describe "#contains?" do - it "returns true if point is inside the image" do - image = Image.new("test/media/image.bmp") - expect(image.contains?(50, 50)).to be true - end - - it "returns true if point is outside the image" do - image = Image.new("test/media/image.bmp") - expect(image.contains?(-50, 50)).to be false - expect(image.contains?(50, -50)).to be false - expect(image.contains?(50, 150)).to be false - expect(image.contains?(150, 50)).to be false - end - end - end -- cgit v1.2.3