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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +2 -2
- data/VERSION +1 -1
- data/glimmer-dsl-libui.gemspec +0 -0
- data/lib/glimmer/libui/control_proxy/path_proxy.rb +5 -1
- data/lib/glimmer/libui/shape/bezier.rb +1 -1
- data/lib/glimmer/libui/shape/figure.rb +12 -0
- data/lib/glimmer/libui/shape/line.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e20f859c1f0147fbdcdfe39d0caf2a284c922f0fd62d848e01a1ac6e6c05b6ee
|
4
|
+
data.tar.gz: a7cdd076d22cfeeb5675780c4f918364fac9f1207aa7d890ed1104effcb1ab3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
[](http://badge.fury.io/rb/glimmer-dsl-libui)
|
4
4
|
[](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.
|
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.
|
1
|
+
0.5.4
|
data/glimmer-dsl-libui.gemspec
CHANGED
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(
|
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: [
|
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: [
|
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.
|
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-
|
11
|
+
date: 2022-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glimmer
|