perfect-shape 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/README.md +3 -3
- data/VERSION +1 -1
- data/lib/perfect_shape/circle.rb +12 -12
- data/lib/perfect_shape/square.rb +6 -6
- data/perfect-shape.gemspec +5 -5
- metadata +10 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e83221df061b944acb69abfec2536a0c0bc3c8176d6f5b4929c68bb6283e7f82
|
4
|
+
data.tar.gz: 5f778729c9b39a259708a0e6995b370f040442b4864f7594418fafdfd1208d12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e18a4d841f70f938c220c21e1d928273d5a24a6f114a4a2b8c0f2c0c6ca020a80510f9dd698a092582607d5bd8a224e5c6c6aea875a443a740d64982ae4f2d4
|
7
|
+
data.tar.gz: 5712f83712d505f3c7156dfd9e194735b73215542c9012bda5359544f72eac4743f00d9e39f97c98a2bee22c43dd45f808554abad3a5ea6f2b983e925f3cadb2
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 1.0.1
|
4
|
+
|
5
|
+
- Relax `equalizer` gem version to '>= 0.0.11', '< 1.1.0' to avoid conflicts in projects that might use future versions
|
6
|
+
- Fix issue with infinite loop upon setting `Circle#radius=` to a number with very small decimals
|
7
|
+
- Fix issue with infinite loop upon setting `Circle#radius_x=` to a number with very small decimals
|
8
|
+
- Fix issue with infinite loop upon setting `Circle#radius_y=` to a number with very small decimals
|
9
|
+
- Fix issue with infinite loop upon setting `Circle#diameter=` to a number with very small decimals
|
10
|
+
- Fix issue with infinite loop upon setting `Circle#width=` to a number with very small decimals
|
11
|
+
- Fix issue with infinite loop upon setting `Circle#height=` to a number with very small decimals
|
12
|
+
- Fix issue with infinite loop upon setting `Square#length=` to a number with very small decimals
|
13
|
+
- Fix issue with infinite loop upon setting `Square#width=` to a number with very small decimals
|
14
|
+
- Fix issue with infinite loop upon setting `Square#height=` to a number with very small decimals
|
15
|
+
|
3
16
|
## 1.0.0
|
4
17
|
|
5
18
|
- `PerfectShape::Path#intersect?(rectangle)`
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Perfect Shape 1.0.
|
1
|
+
# Perfect Shape 1.0.1
|
2
2
|
## Geometric Algorithms
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/perfect-shape.svg)](http://badge.fury.io/rb/perfect-shape)
|
4
4
|
[![Test](https://github.com/AndyObtiva/perfect-shape/actions/workflows/ruby.yml/badge.svg)](https://github.com/AndyObtiva/perfect-shape/actions/workflows/ruby.yml)
|
@@ -14,13 +14,13 @@ To ensure high accuracy, this library does all its mathematical operations with
|
|
14
14
|
Run:
|
15
15
|
|
16
16
|
```
|
17
|
-
gem install perfect-shape -v 1.0.
|
17
|
+
gem install perfect-shape -v 1.0.1
|
18
18
|
```
|
19
19
|
|
20
20
|
Or include in Bundler `Gemfile`:
|
21
21
|
|
22
22
|
```ruby
|
23
|
-
gem 'perfect-shape', '~> 1.0.
|
23
|
+
gem 'perfect-shape', '~> 1.0.1'
|
24
24
|
```
|
25
25
|
|
26
26
|
And, run:
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.1
|
data/lib/perfect_shape/circle.rb
CHANGED
@@ -52,40 +52,40 @@ module PerfectShape
|
|
52
52
|
def diameter=(value)
|
53
53
|
@diameter = BigDecimal(value.to_s)
|
54
54
|
@radius = nil
|
55
|
-
self.width =
|
56
|
-
self.height =
|
55
|
+
self.width = @diameter unless width == @diameter
|
56
|
+
self.height = @diameter unless height == @diameter
|
57
57
|
end
|
58
58
|
|
59
59
|
# Sets radius, normalizing to BigDecimal
|
60
60
|
def radius=(value)
|
61
61
|
@radius = BigDecimal(value.to_s)
|
62
62
|
@diameter = nil
|
63
|
-
self.radius_x =
|
64
|
-
self.radius_y =
|
63
|
+
self.radius_x = @radius unless @width == @radius
|
64
|
+
self.radius_y = @radius unless @height == @radius
|
65
65
|
end
|
66
66
|
|
67
67
|
def width=(value)
|
68
68
|
super
|
69
|
-
self.diameter =
|
70
|
-
self.height =
|
69
|
+
self.diameter = @width unless diameter == @width
|
70
|
+
self.height = @width unless height == @width
|
71
71
|
end
|
72
72
|
|
73
73
|
def height=(value)
|
74
74
|
super
|
75
|
-
self.diameter =
|
76
|
-
self.width =
|
75
|
+
self.diameter = @height unless diameter == @height
|
76
|
+
self.width = @height unless width == @height
|
77
77
|
end
|
78
78
|
|
79
79
|
def radius_x=(value)
|
80
80
|
super
|
81
|
-
self.radius =
|
82
|
-
self.radius_y =
|
81
|
+
self.radius = @radius_x unless radius == @radius_x
|
82
|
+
self.radius_y = @radius_x unless radius_y == @radius_x
|
83
83
|
end
|
84
84
|
|
85
85
|
def radius_y=(value)
|
86
86
|
super
|
87
|
-
self.radius =
|
88
|
-
self.radius_x =
|
87
|
+
self.radius = @radius_y unless radius == @radius_y
|
88
|
+
self.radius_x = @radius_y unless radius_x == @radius_y
|
89
89
|
end
|
90
90
|
end
|
91
91
|
end
|
data/lib/perfect_shape/square.rb
CHANGED
@@ -40,21 +40,21 @@ module PerfectShape
|
|
40
40
|
# Sets length, normalizing to BigDecimal
|
41
41
|
def length=(value)
|
42
42
|
@length = BigDecimal(value.to_s)
|
43
|
-
self.width =
|
44
|
-
self.height =
|
43
|
+
self.width = @length unless width == @length
|
44
|
+
self.height = @length unless height == @length
|
45
45
|
end
|
46
46
|
alias size= length=
|
47
47
|
|
48
48
|
def width=(value)
|
49
49
|
super
|
50
|
-
self.length =
|
51
|
-
self.height =
|
50
|
+
self.length = @width unless length == @width
|
51
|
+
self.height = @width unless height == @width
|
52
52
|
end
|
53
53
|
|
54
54
|
def height=(value)
|
55
55
|
super
|
56
|
-
self.length =
|
57
|
-
self.width =
|
56
|
+
self.length = @height unless length == @height
|
57
|
+
self.width = @height unless width == @height
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
data/perfect-shape.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: perfect-shape 1.0.
|
5
|
+
# stub: perfect-shape 1.0.1 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "perfect-shape".freeze
|
9
|
-
s.version = "1.0.
|
9
|
+
s.version = "1.0.1"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Andy Maleh".freeze]
|
14
|
-
s.date = "2022-
|
14
|
+
s.date = "2022-02-16"
|
15
15
|
s.description = "Perfect Shape is a collection of pure Ruby geometric algorithms that are mostly useful for GUI manipulation like checking viewport rectangle intersection or containment of a mouse click point in popular geometry shapes such as rectangle, square, arc (open, chord, and pie), ellipse, circle, polygon, and paths containing lines, quadratic b\u00E9zier curves, and cubic bezier curves, potentially with affine transforms applied like translation, scale, rotation, shear/skew, and inversion (including both Ray Casting Algorithm, aka Even-odd Rule, and Winding Number Algorithm, aka Nonzero Rule). Additionally, it contains some purely mathematical algorithms like IEEEremainder (also known as IEEE-754 remainder).".freeze
|
16
16
|
s.email = "andy.am@gmail.com".freeze
|
17
17
|
s.extra_rdoc_files = [
|
@@ -55,14 +55,14 @@ Gem::Specification.new do |s|
|
|
55
55
|
end
|
56
56
|
|
57
57
|
if s.respond_to? :add_runtime_dependency then
|
58
|
-
s.add_runtime_dependency(%q<equalizer>.freeze, ["
|
58
|
+
s.add_runtime_dependency(%q<equalizer>.freeze, [">= 0.0.11", "< 1.1.0"])
|
59
59
|
s.add_development_dependency(%q<rdoc>.freeze, ["~> 3.12"])
|
60
60
|
s.add_development_dependency(%q<juwelier>.freeze, ["~> 2.1.0"])
|
61
61
|
s.add_development_dependency(%q<minitest>.freeze, ["~> 5.14.4"])
|
62
62
|
s.add_development_dependency(%q<puts_debuggerer>.freeze, ["~> 0.13.1"])
|
63
63
|
s.add_development_dependency(%q<rake-tui>.freeze, ["> 0"])
|
64
64
|
else
|
65
|
-
s.add_dependency(%q<equalizer>.freeze, ["
|
65
|
+
s.add_dependency(%q<equalizer>.freeze, [">= 0.0.11", "< 1.1.0"])
|
66
66
|
s.add_dependency(%q<rdoc>.freeze, ["~> 3.12"])
|
67
67
|
s.add_dependency(%q<juwelier>.freeze, ["~> 2.1.0"])
|
68
68
|
s.add_dependency(%q<minitest>.freeze, ["~> 5.14.4"])
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: perfect-shape
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Maleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: equalizer
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.0.11
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.1.0
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- -
|
27
|
+
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: 0.0.11
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.1.0
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: rdoc
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|