rays 0.1.46 → 0.1.47

Sign up to get free protection for your applications and to get access to all the features.
data/src/polyline.h CHANGED
@@ -52,11 +52,11 @@ namespace Rays
52
52
 
53
53
  void Polyline_create (
54
54
  Polyline* polyline, const ClipperLib::Path& path, bool loop,
55
- bool reverse = false);
55
+ bool hole = false);
56
56
 
57
57
  void Polyline_get_path (
58
58
  ClipperLib::Path* path, const Polyline& polyline,
59
- bool reverse = false);
59
+ bool hole = false);
60
60
 
61
61
  bool Polyline_expand (
62
62
  Polygon* result, const Polyline& polyline,
data/test/test_bitmap.rb CHANGED
@@ -31,6 +31,13 @@ class TestBitmap < Test::Unit::TestCase
31
31
  assert_equal color(1, 0, 0, 0), o[0, 0]
32
32
  end
33
33
 
34
+ def test_pixels()
35
+ colors = %w[#f00 #0f0 #00f #ff0].map {|s| color s}
36
+ bmp = bitmap 2, 2
37
+ bmp[0, 0], bmp[1, 0], bmp[0, 1], bmp[1, 1] = colors
38
+ assert_equal [0xffff0000, 0xff00ff00, 0xff0000ff, 0xffffff00], bmp.pixels
39
+ end
40
+
34
41
  def test_at()
35
42
  o = bitmap
36
43
  assert_equal color(0, 0, 0, 0), o[0, 0]
data/test/test_polygon.rb CHANGED
@@ -48,11 +48,11 @@ class TestPolygon < Test::Unit::TestCase
48
48
  assert_nothing_raised {polygon( loop: false)}
49
49
  assert_raise(ArgumentError) {polygon(1, loop: true)}
50
50
  assert_raise(ArgumentError) {polygon(1, loop: false)}
51
- assert_raise(ArgumentError) {polygon(1, 2, loop: true)}
51
+ assert_nothing_raised {polygon(1, 2, loop: true)}
52
52
  assert_nothing_raised {polygon(1, 2, loop: false)}
53
53
  assert_raise(ArgumentError) {polygon(1, 2, 3, loop: true)}
54
54
  assert_raise(ArgumentError) {polygon(1, 2, 3, loop: false)}
55
- assert_raise(ArgumentError) {polygon(1, 2, 3, 4, loop: true)}
55
+ assert_nothing_raised {polygon(1, 2, 3, 4, loop: true)}
56
56
  assert_nothing_raised {polygon(1, 2, 3, 4, loop: false)}
57
57
  assert_raise(ArgumentError) {polygon(1, 2, 3, 4, 5, loop: true)}
58
58
  assert_raise(ArgumentError) {polygon(1, 2, 3, 4, 5, loop: false)}
@@ -41,7 +41,7 @@ class TestPolygonLine < Test::Unit::TestCase
41
41
  assert_raise(ArgumentError) {line(1, 2, 3, 4, 5, 6, loop: false, hole: true ).loop_hole}
42
42
  assert_equal [false, false], line(1, 2, 3, 4, 5, 6, loop: false, hole: false).loop_hole
43
43
 
44
- assert_raise(ArgumentError) {line( loop: true, hole: true )}
44
+ assert_nothing_raised {line( loop: true, hole: true )}
45
45
  assert_nothing_raised {line( loop: true, hole: false)}
46
46
  assert_raise(ArgumentError) {line( loop: false, hole: true )}
47
47
  assert_nothing_raised {line( loop: false, hole: false)}
@@ -49,16 +49,16 @@ class TestPolygonLine < Test::Unit::TestCase
49
49
  assert_raise(ArgumentError) {line(1, loop: true, hole: false)}
50
50
  assert_raise(ArgumentError) {line(1, loop: false, hole: true )}
51
51
  assert_raise(ArgumentError) {line(1, loop: false, hole: false)}
52
- assert_raise(ArgumentError) {line(1, 2, loop: true, hole: true )}
53
- assert_raise(ArgumentError) {line(1, 2, loop: true, hole: false)}
52
+ assert_nothing_raised {line(1, 2, loop: true, hole: true )}
53
+ assert_nothing_raised {line(1, 2, loop: true, hole: false)}
54
54
  assert_raise(ArgumentError) {line(1, 2, loop: false, hole: true )}
55
55
  assert_nothing_raised {line(1, 2, loop: false, hole: false)}
56
56
  assert_raise(ArgumentError) {line(1, 2, 3, loop: true, hole: true )}
57
57
  assert_raise(ArgumentError) {line(1, 2, 3, loop: true, hole: false)}
58
58
  assert_raise(ArgumentError) {line(1, 2, 3, loop: false, hole: true )}
59
59
  assert_raise(ArgumentError) {line(1, 2, 3, loop: false, hole: false)}
60
- assert_raise(ArgumentError) {line(1, 2, 3, 4, loop: true, hole: true )}
61
- assert_raise(ArgumentError) {line(1, 2, 3, 4, loop: true, hole: false)}
60
+ assert_nothing_raised {line(1, 2, 3, 4, loop: true, hole: true )}
61
+ assert_nothing_raised {line(1, 2, 3, 4, loop: true, hole: false)}
62
62
  assert_raise(ArgumentError) {line(1, 2, 3, 4, loop: false, hole: true )}
63
63
  assert_nothing_raised {line(1, 2, 3, 4, loop: false, hole: false)}
64
64
  assert_raise(ArgumentError) {line(1, 2, 3, 4, 5, loop: true, hole: true )}
@@ -27,21 +27,21 @@ class TestPolyline < Test::Unit::TestCase
27
27
  assert_equal [[1, 1], [2, 2]], polyline( [1], [2]).dump
28
28
  assert_equal [[1, 1], [2, 2]], polyline(point(1), point(2)).dump
29
29
 
30
- assert_equal false, polyline(1, 2, 3, 4, 5, 6 ).loop?
31
- assert_equal true, polyline(1, 2, 3, 4, 5, 6, loop: true ).loop?
32
- assert_equal false, polyline(1, 2, 3, 4, 5, 6, loop: false).loop?
33
- assert_equal false, polyline( loop: true ).loop?
34
- assert_equal false, polyline( loop: false).loop?
30
+ assert_false polyline(1, 2, 3, 4, 5, 6 ).loop?
31
+ assert_true polyline(1, 2, 3, 4, 5, 6, loop: true ).loop?
32
+ assert_false polyline(1, 2, 3, 4, 5, 6, loop: false).loop?
33
+ assert_true polyline( loop: true ).loop?
34
+ assert_false polyline( loop: false).loop?
35
35
 
36
36
  assert_nothing_raised {polyline( loop: true)}
37
37
  assert_nothing_raised {polyline( loop: false)}
38
38
  assert_raise(ArgumentError) {polyline(1, loop: true)}
39
39
  assert_raise(ArgumentError) {polyline(1, loop: false)}
40
- assert_raise(ArgumentError) {polyline(1, 2, loop: true)}
40
+ assert_nothing_raised {polyline(1, 2, loop: true)}
41
41
  assert_nothing_raised {polyline(1, 2, loop: false)}
42
42
  assert_raise(ArgumentError) {polyline(1, 2, 3, loop: true)}
43
43
  assert_raise(ArgumentError) {polyline(1, 2, 3, loop: false)}
44
- assert_raise(ArgumentError) {polyline(1, 2, 3, 4, loop: true)}
44
+ assert_nothing_raised {polyline(1, 2, 3, 4, loop: true)}
45
45
  assert_nothing_raised {polyline(1, 2, 3, 4, loop: false)}
46
46
  assert_raise(ArgumentError) {polyline(1, 2, 3, 4, 5, loop: true)}
47
47
  assert_raise(ArgumentError) {polyline(1, 2, 3, 4, 5, loop: false)}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rays
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.46
4
+ version: 0.1.47
5
5
  platform: ruby
6
6
  authors:
7
7
  - xordog
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-08 00:00:00.000000000 Z
11
+ date: 2023-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xot
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.1.40
19
+ version: 0.1.41
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.1.40
26
+ version: 0.1.41
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rucy
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.1.41
33
+ version: 0.1.42
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.1.41
40
+ version: 0.1.42
41
41
  description: This library helps you to develop graphics application with OpenGL.
42
42
  email: xordog@gmail.com
43
43
  executables: []