motion-kit 0.10.3 → 0.10.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b421fd69490b2630780a1b9bab2ffd51046ac3b8
4
- data.tar.gz: ba3cc35a64cd442eb5f81b16690da74c04c85171
3
+ metadata.gz: 75784fe191e7e2d7d542feba6044bc6800815ceb
4
+ data.tar.gz: 447dc3b5237ba7c1b825d651b0d52968f23f40fd
5
5
  SHA512:
6
- metadata.gz: be5d06c82a29b217674f8f2243fae01d04c27feb5372ebe6ae6302c1ce31c3e0863b7416d6ed0a0825816310c52262e6a1c6ca1cf7b1103d400f87b3a92ee6f4
7
- data.tar.gz: 00a89e9b73436c7432e98d04dd60903c4dc06c7dddc702b6d3dbdccd2c065cf0c797b855dbe4a787495ed9f5b7e5cfb0d036ad29bba7292ffa9c15db278cfc86
6
+ metadata.gz: 0a6bd50fe3b55a323bd04ecacfbf35a58fe0720f10ec3657acdd77bb868767e24f6905723aa52f959e577e868e9a93b6191a0e0c70bb7ab9b76c473a221a3e10
7
+ data.tar.gz: c47ccad04b7b15fdad7f0f9f7239f531c36f3125d3c362ab53392b24892b7f9769084926550bb31d2f967a0094976657715d4480ab7814bc3023e781df0bbc5f
@@ -1,3 +1,3 @@
1
1
  module MotionKit
2
- VERSION = '0.10.3'
2
+ VERSION = '0.10.4'
3
3
  end
@@ -97,11 +97,7 @@ module MotionKit
97
97
  from_view_size = from_view.frame.size
98
98
  o = from_view.convertPoint([0, 0], toView: target.superview)
99
99
 
100
- calculate_view = target
101
-
102
- if point[:x] == :reset || point[:y] == :reset
103
- calculate_view = UIView.alloc.initWithFrame([[0, 0], target.frame.size])
104
- end
100
+ calculate_view = UIView.alloc.initWithFrame([[0, 0], target.frame.size])
105
101
 
106
102
  if f.is_a?(Hash)
107
103
  f = f.merge(relative: true)
@@ -0,0 +1,66 @@
1
+ describe 'Views frames should remain unchanged' do
2
+
3
+ before do
4
+ @subject = ReapplyTestLayout.new
5
+ @cw = @subject.view.frame.size.width # container width
6
+ @ch = @subject.view.frame.size.height # container height
7
+ end
8
+
9
+ it "top_left should be in the right position before and after reapply" do
10
+ @subject.get(:top_left).frame.should == CGRectMake(0,0,10,10)
11
+ @subject.reapply!
12
+ @subject.get(:top_left).frame.should == CGRectMake(0,0,10,10)
13
+ end
14
+
15
+ it "top should be in the right position before and after reapply" do
16
+ NSLog("top frame before reapply = #{@subject.get(:top).frame.inspect}")
17
+ @subject.get(:top).frame.should == CGRectMake(@cw/2 - 5, 0, 10, 10)
18
+ @subject.reapply!
19
+ NSLog("top frame after reapply = #{@subject.get(:top).frame.inspect}")
20
+ @subject.get(:top).frame.should == CGRectMake(@cw/2 - 5, 0, 10, 10)
21
+ end
22
+
23
+ it "top_right should be in the right position before and after reapply" do
24
+ @subject.get(:top_right).frame.should == CGRectMake(@cw - 10, 0, 10, 10)
25
+ @subject.reapply!
26
+ @subject.get(:top_right).frame.should == CGRectMake(@cw - 10, 0, 10, 10)
27
+ end
28
+
29
+ it "left should be in the right position before and after reapply" do
30
+ @subject.get(:left).frame.should == CGRectMake(0, @ch/2 - 5, 10, 10)
31
+ @subject.reapply!
32
+ @subject.get(:left).frame.should == CGRectMake(0, @ch/2 - 5, 10, 10)
33
+ end
34
+
35
+ it "center should be in the right position before and after reapply" do
36
+ @subject.get(:center).frame.should == CGRectMake(@cw/2 - 5, @ch/2 - 5, 10, 10)
37
+ @subject.reapply!
38
+ @subject.get(:center).frame.should == CGRectMake(@cw/2 - 5, @ch/2 - 5, 10, 10)
39
+ end
40
+
41
+ it "right should be in the right position before and after reapply" do
42
+ @subject.get(:right).frame.should == CGRectMake(@cw - 10, @ch/2 - 5, 10, 10)
43
+ @subject.reapply!
44
+ @subject.get(:right).frame.should == CGRectMake(@cw - 10, @ch/2 - 5, 10, 10)
45
+ end
46
+
47
+ it "bottom_left should be in the right position before and after reapply" do
48
+ @subject.get(:bottom_left).frame.should == CGRectMake(0, @ch - 10, 10, 10)
49
+ @subject.reapply!
50
+ @subject.get(:bottom_left).frame.should == CGRectMake(0, @ch - 10, 10, 10)
51
+ end
52
+
53
+ it "bottom should be in the right position before and after reapply" do
54
+ @subject.get(:bottom).frame.should == CGRectMake(@cw/2 - 5, @ch - 10, 10, 10)
55
+ @subject.reapply!
56
+ @subject.get(:bottom).frame.should == CGRectMake(@cw/2 - 5, @ch - 10, 10, 10)
57
+ end
58
+
59
+ it "bottom_right should be in the right position before and after reapply" do
60
+ @subject.get(:bottom_right).frame.should == CGRectMake(@cw - 10, @ch - 10, 10, 10)
61
+ @subject.reapply!
62
+ @subject.get(:bottom_right).frame.should == CGRectMake(@cw - 10, @ch - 10, 10, 10)
63
+ end
64
+
65
+ end
66
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.3
4
+ version: 0.10.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Colin T.A. Gray
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-06-11 00:00:00.000000000 Z
12
+ date: 2014-06-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dbt
@@ -108,6 +108,7 @@ files:
108
108
  - spec/ios/orientation_helper_specs.rb
109
109
  - spec/ios/parent_layout_spec.rb
110
110
  - spec/ios/parent_spec.rb
111
+ - spec/ios/reapply_frame.rb
111
112
  - spec/ios/relative_layout.spec.rb
112
113
  - spec/ios/remove_layout_spec.rb
113
114
  - spec/ios/root_layout_spec.rb
@@ -184,6 +185,7 @@ test_files:
184
185
  - spec/ios/orientation_helper_specs.rb
185
186
  - spec/ios/parent_layout_spec.rb
186
187
  - spec/ios/parent_spec.rb
188
+ - spec/ios/reapply_frame.rb
187
189
  - spec/ios/relative_layout.spec.rb
188
190
  - spec/ios/remove_layout_spec.rb
189
191
  - spec/ios/root_layout_spec.rb