purplish-frame 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90876eb06332ec791c11d93c4bee5b9525782de9
|
4
|
+
data.tar.gz: a2857542fb38da5ee9f93be0f5c20fcc752297a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03025a3938eccd8791f3fcb056df132153ca38f2903466f96165dfa232dddd9458169fe7374bc0bae965f95256dfae77858a67ec3e8dd55b8c19bbfaea1f84fc
|
7
|
+
data.tar.gz: 6283dcfe6f86c6dac17b064ad7b4c0ce26d8b70a68dfb5160275236d45d01a5b0b6cf3440eac3ad55cdc8d10c2b82b0e21957a6dcb0da1ea95d79185b99f5b9c
|
@@ -7,5 +7,21 @@ module PurplishFrame
|
|
7
7
|
def /(aNumber)
|
8
8
|
self.class.new(x/aNumber, y/aNumber)
|
9
9
|
end
|
10
|
+
|
11
|
+
def close_to?(point, delta=[4, 4])
|
12
|
+
point = point.to_point
|
13
|
+
delta = delta.to_point
|
14
|
+
x.close_to?(point.x, delta.x) && y.close_to?(point.y, delta.y)
|
15
|
+
end
|
16
|
+
|
17
|
+
def distance_from(point)
|
18
|
+
point = point.to_point
|
19
|
+
Math.sqrt((x-point.x)*(x-point.x) + (y-point.y)*(y-point.y))
|
20
|
+
end
|
21
|
+
|
22
|
+
def extent(size)
|
23
|
+
size = size.to_size
|
24
|
+
[[x, y], [size.width, size.height]].to_rect
|
25
|
+
end
|
10
26
|
end
|
11
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: purplish-frame
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hwee-Boon Yar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Make working with rects, sizes and points more convenient with RubyMotion
|
14
14
|
for iOS & OS X
|
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
85
|
version: '0'
|
86
86
|
requirements: []
|
87
87
|
rubyforge_project:
|
88
|
-
rubygems_version: 2.
|
88
|
+
rubygems_version: 2.5.1
|
89
89
|
signing_key:
|
90
90
|
specification_version: 4
|
91
91
|
summary: Make working with rects, sizes and points more convenient with RubyMotion
|