ruby2d 0.4.0 → 0.4.1
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 +4 -4
- data/ext/ruby2d/ruby2d.c +8 -2
- data/lib/ruby2d/image.rb +3 -1
- data/lib/ruby2d/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a8a4ec99e4973a77f73aa07a46accf88b4d6ab4
|
4
|
+
data.tar.gz: 73fbe78e3065d33795a1da5bb187b118075f9f58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18d3baa25a0dc7819f7b22ad49add7f1562356cc978aa52886020c68a54586063ab7ef4cecad07482c4933c8dd82955a7cfb2143b2c00cf1fc737c191ed68f00
|
7
|
+
data.tar.gz: fd5aed42f38a5431f8f7821c062cf5b52ee4ecf31c36990dd4e5b477bb064e00b719478356abdd93cadbff0e4ad64b33ae8ab85c273b625fcb5ef663bbac220c
|
data/ext/ruby2d/ruby2d.c
CHANGED
@@ -174,8 +174,14 @@ static R_VAL ruby2d_image_init(R_VAL self, R_VAL path) {
|
|
174
174
|
sprintf(S2D_msg, "Init image: %s", RSTRING_PTR(path));
|
175
175
|
S2D_Log(S2D_msg, S2D_INFO);
|
176
176
|
S2D_Image *img = S2D_CreateImage(RSTRING_PTR(path));
|
177
|
-
|
178
|
-
|
177
|
+
|
178
|
+
// Get width and height from Ruby class. If set, use it, else choose the
|
179
|
+
// native dimensions of the image.
|
180
|
+
R_VAL w = r_iv_get(self, "@width");
|
181
|
+
R_VAL h = r_iv_get(self, "@height");
|
182
|
+
r_iv_set(self, "@width" , r_test(w) ? w : INT2NUM(img->width));
|
183
|
+
r_iv_set(self, "@height", r_test(h) ? h : INT2NUM(img->height));
|
184
|
+
|
179
185
|
r_iv_set(self, "@data", r_data_wrap_struct(image, img));
|
180
186
|
return R_NIL;
|
181
187
|
}
|
data/lib/ruby2d/image.rb
CHANGED
data/lib/ruby2d/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby2d
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Black
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|