sugarcube 0.18.0 → 0.18.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sugarcube/uiview.rb +12 -6
- data/lib/sugarcube/version.rb +1 -1
- data/spec/uiview_animation_spec.rb +8 -1
- metadata +2 -2
data/lib/sugarcube/uiview.rb
CHANGED
@@ -41,12 +41,18 @@ class UIView
|
|
41
41
|
after_adjusted = nil
|
42
42
|
end
|
43
43
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
44
|
+
delay = options[:delay] || 0
|
45
|
+
if duration == 0 && delay == 0
|
46
|
+
animations.call
|
47
|
+
after_adjusted.call(true)
|
48
|
+
else
|
49
|
+
UIView.animateWithDuration( duration,
|
50
|
+
delay: delay,
|
51
|
+
options: options[:options] || UIViewAnimationOptionCurveEaseInOut,
|
52
|
+
animations: animations,
|
53
|
+
completion: after_adjusted
|
54
|
+
)
|
55
|
+
end
|
50
56
|
nil
|
51
57
|
end
|
52
58
|
|
data/lib/sugarcube/version.rb
CHANGED
@@ -6,11 +6,18 @@ describe "UIView animation methods" do
|
|
6
6
|
it 'should delta_to x:1 y:2' do
|
7
7
|
@view.delta_to([1,2]).frame.should == CGRectMake(2,4,3,4)
|
8
8
|
end
|
9
|
-
|
9
|
+
|
10
10
|
it 'should rotate 45 degrees' do
|
11
11
|
angle = 45*Math::PI/180
|
12
12
|
@view.rotate_to(angle)
|
13
13
|
current_angle = Math.atan2(@view.transform.b, @view.transform.a)
|
14
14
|
current_angle.should == angle
|
15
15
|
end
|
16
|
+
|
17
|
+
it 'should animate anything' do
|
18
|
+
UIView.animate {
|
19
|
+
@view.frame = [[0, 0], [0, 0]]
|
20
|
+
}
|
21
|
+
CGRectEqualToRect(@view.frame, [[0, 0], [0, 0]]).should == true
|
22
|
+
end
|
16
23
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sugarcube
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.18.
|
4
|
+
version: 0.18.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2013-02-
|
16
|
+
date: 2013-02-16 00:00:00.000000000 Z
|
17
17
|
dependencies: []
|
18
18
|
description: ! '== Description
|
19
19
|
|