sugarcube 1.0.1 → 1.0.2
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.
- data/.travis.yml +1 -0
- data/Gemfile.lock +1 -1
- data/lib/sugarcube/adjust.rb +1 -1
- data/lib/sugarcube/version.rb +1 -1
- data/lib/sugarcube-image/uiimage.rb +15 -0
- data/sugarcube.gemspec +1 -0
- metadata +4 -3
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
data/lib/sugarcube/adjust.rb
CHANGED
data/lib/sugarcube/version.rb
CHANGED
@@ -31,6 +31,21 @@ class UIImage
|
|
31
31
|
return new_image
|
32
32
|
end
|
33
33
|
|
34
|
+
# Returns a cropped UIImage
|
35
|
+
def crop(rect)
|
36
|
+
if self.scale > 1.0
|
37
|
+
rect = CGRectMake(rect.origin.x * self.scale,
|
38
|
+
rect.origin.y * self.scale,
|
39
|
+
rect.size.width * self.scale,
|
40
|
+
rect.size.height * self.scale)
|
41
|
+
end
|
42
|
+
|
43
|
+
cgimage = CGImageCreateWithImageInRect(self.CGImage, rect)
|
44
|
+
result = UIImage.imageWithCGImage(cgimage, scale:self.scale, orientation:self.imageOrientation)
|
45
|
+
|
46
|
+
return result
|
47
|
+
end
|
48
|
+
|
34
49
|
##|
|
35
50
|
##| image scaling
|
36
51
|
##|
|
data/sugarcube.gemspec
CHANGED
@@ -4,6 +4,7 @@ require File.expand_path('../lib/sugarcube/version.rb', __FILE__)
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.name = 'sugarcube'
|
6
6
|
gem.version = SugarCube::Version
|
7
|
+
gem.licenses = ['BSD']
|
7
8
|
|
8
9
|
gem.authors = ['Colin T.A. Gray', 'Thom Parkin', 'Katsuyoshi Ito', 'Michael Erasmus']
|
9
10
|
gem.email = ['colinta@gmail.com']
|
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: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2013-07-
|
15
|
+
date: 2013-07-29 00:00:00.000000000 Z
|
16
16
|
dependencies: []
|
17
17
|
description: ! '== Description
|
18
18
|
|
@@ -245,7 +245,8 @@ files:
|
|
245
245
|
- spec/unholy_spec.rb
|
246
246
|
- sugarcube.gemspec
|
247
247
|
homepage: https://github.com/rubymotion/sugarcube
|
248
|
-
licenses:
|
248
|
+
licenses:
|
249
|
+
- BSD
|
249
250
|
post_install_message:
|
250
251
|
rdoc_options: []
|
251
252
|
require_paths:
|