glimmer-dsl-libui 0.5.3 → 0.5.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '08fe50ceac6ad2e11ec6599ba592d0a040cd4b7158a788dd8d001fddfa7e337e'
4
- data.tar.gz: b10af93758d8b4141962c9b73c87f16419f302785b29b84cf62befe86181d507
3
+ metadata.gz: e20f859c1f0147fbdcdfe39d0caf2a284c922f0fd62d848e01a1ac6e6c05b6ee
4
+ data.tar.gz: a7cdd076d22cfeeb5675780c4f918364fac9f1207aa7d890ed1104effcb1ab3b
5
5
  SHA512:
6
- metadata.gz: ffcf60fe7615eaac2109035a3ce64510ca2f76c5726c2c1c48fe0adba98ad1780c5f599fc9cb154ed789571710e5e2239f950e8dc16ec041f4727e5d0bfcef53
7
- data.tar.gz: 4bb634aec81f105cd2de9aa9b2e0e3b4bd9c0eb1e715b8309cbdb4f7cd42113631e2f9d51e3db14ea9362bde930d6602ee23d7df6bb987edaf337a0d94f2756d
6
+ metadata.gz: abe17c4c1f3a398cf3e318a68e8502ab8c657e55e80f90c9ecaa5980e16494732a970e023421d9b5bf39908ab06360458fa3cff08776879b701912c00cf86fab
7
+ data.tar.gz: 5c7224ebd340795677d51673fc1d6f477f4db15134ce683f4dc16f3b29c070cc34eedf748b4ffd81c41fec22e95beeac50c34ab0263826591baf420f111592f4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.5.4
4
+
5
+ - Support `figure` `bounding_box` (minx, miny, width, height), `contain?` method (checking if shape contains point inside) and `include?` method (checking on outline if stroked and inside if filled?)
6
+ - Have `path` `draw_fill_mode` return `:winding` or `:alternate` while `draw_fill_mode_value` returns `0` or `1` respectively
7
+
3
8
  ## 0.5.3
4
9
 
5
10
  - Support `polyline` `bounding_box` (minx, miny, width, height), `contain?` method (checking if shape contains point inside) and `include?` method (checking on outline if stroked and inside if filled?)
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for LibUI 0.5.3
1
+ # [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for LibUI 0.5.4
2
2
  ## Prerequisite-Free Ruby Desktop Development GUI Library
3
3
  [![Gem Version](https://badge.fury.io/rb/glimmer-dsl-libui.svg)](http://badge.fury.io/rb/glimmer-dsl-libui)
4
4
  [![Join the chat at https://gitter.im/AndyObtiva/glimmer](https://badges.gitter.im/AndyObtiva/glimmer.svg)](https://gitter.im/AndyObtiva/glimmer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
@@ -519,7 +519,7 @@ gem install glimmer-dsl-libui
519
519
  Or install via Bundler `Gemfile`:
520
520
 
521
521
  ```ruby
522
- gem 'glimmer-dsl-libui', '~> 0.5.3'
522
+ gem 'glimmer-dsl-libui', '~> 0.5.4'
523
523
  ```
524
524
 
525
525
  Test that installation worked by running the [Meta-Example](#examples):
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.3
1
+ 0.5.4
Binary file
@@ -60,6 +60,10 @@ module Glimmer
60
60
  end
61
61
 
62
62
  def draw_fill_mode
63
+ @args[0].is_a?(Integer) ? (@args[0] == 0 ? :winding : :alternate ) : ((@args[0].is_a?(String) || @args[0].is_a?(Symbol)) ? @args[0].to_sym : :winding)
64
+ end
65
+
66
+ def draw_fill_mode_value
63
67
  @args[0].is_a?(Integer) ? @args[0] : @args[0].to_s == 'alternate' ? 1 : 0
64
68
  end
65
69
 
@@ -159,7 +163,7 @@ module Glimmer
159
163
  private
160
164
 
161
165
  def build_control
162
- @libui = ::LibUI.draw_new_path(draw_fill_mode)
166
+ @libui = ::LibUI.draw_new_path(draw_fill_mode_value)
163
167
  end
164
168
 
165
169
  def init_draw_brush(draw_brush, draw_brush_args)
@@ -54,7 +54,7 @@ module Glimmer
54
54
  perfect_shape_dependencies = [x, y, c1_x, c1_y, c2_x, c2_y, end_x, end_y]
55
55
  if perfect_shape_dependencies != @perfect_shape_dependencies
56
56
  x, y, c1_x, c1_y, c2_x, c2_y, end_x, end_y = @perfect_shape_dependencies = perfect_shape_dependencies
57
- @perfect_shape = PerfectShape::CubicBezierCurve.new(points: [[x, y], [c1_x, c1_y], [c2_x, c2_y], [end_x, end_y]])
57
+ @perfect_shape = PerfectShape::CubicBezierCurve.new(points: [x, y, c1_x, c1_y, c2_x, c2_y, end_x, end_y].compact)
58
58
  end
59
59
  @perfect_shape
60
60
  end
@@ -50,6 +50,18 @@ module Glimmer
50
50
  alias closed= closed
51
51
  alias set_closed closed
52
52
  alias closed? closed
53
+
54
+ def perfect_shape
55
+ perfect_shape_dependencies = [x, y, closed, parent.draw_fill_mode, children]
56
+ if perfect_shape_dependencies != @perfect_shape_dependencies
57
+ x, y, closed, draw_fill_mode, children = @perfect_shape_dependencies = perfect_shape_dependencies
58
+ path_shapes = [[x, y]]
59
+ path_shapes += children.map(&:perfect_shape)
60
+ winding_rule = draw_fill_mode == :winding ? :wind_non_zero : :wind_even_odd
61
+ @perfect_shape = PerfectShape::Path.new(closed: closed, winding_rule: winding_rule, shapes: path_shapes)
62
+ end
63
+ @perfect_shape
64
+ end
53
65
  end
54
66
  end
55
67
  end
@@ -57,7 +57,7 @@ module Glimmer
57
57
  perfect_shape_dependencies = [x, y, end_x, end_y]
58
58
  if perfect_shape_dependencies != @perfect_shape_dependencies
59
59
  x, y, end_x, end_y = @perfect_shape_dependencies = perfect_shape_dependencies
60
- @perfect_shape = PerfectShape::Line.new(points: [[x, y], [end_x, end_y]])
60
+ @perfect_shape = PerfectShape::Line.new(points: [x, y, end_x, end_y].compact)
61
61
  end
62
62
  @perfect_shape
63
63
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-libui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-19 00:00:00.000000000 Z
11
+ date: 2022-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: glimmer