svg_drawer 1.2.0 → 1.2.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/lib/svg_drawer/text_box.rb +3 -2
- data/lib/svg_drawer/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: e20b212c8dbf5477c1958ababd22b93d25fef505
|
|
4
|
+
data.tar.gz: 38f8d9d0dd4784aa176443009a3130f2da2f1518
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 95b7f567b0d5f3b2b624c9978ae699812d65af2e5e469c70fb89ec39873550936762a6801f584a6fa5923d709af719acadf3e1603b4dc1bd506e36a7c76ad5d1
|
|
7
|
+
data.tar.gz: c20c30a31b676d3d091401f88228ae43a693701ccc1f97c94f2fc90d1343c2a4e47d4d2a1541c694a297a91b7392a3907c750ea7e96e9cbc307cd4f31b266c28
|
data/lib/svg_drawer/text_box.rb
CHANGED
|
@@ -8,6 +8,7 @@ module SvgDrawer
|
|
|
8
8
|
text_align: 'left',
|
|
9
9
|
text_valign: 'bottom',
|
|
10
10
|
line_height: 1,
|
|
11
|
+
wrap: true,
|
|
11
12
|
wrap_policy: 'normal',
|
|
12
13
|
word_pattern: /[[:word:]]+[^[:word:]]\s?(?![^[:word:]])|[[:word:]]+|[^[:word:]]/,
|
|
13
14
|
overflow: false,
|
|
@@ -33,7 +34,7 @@ module SvgDrawer
|
|
|
33
34
|
def height
|
|
34
35
|
return @height if @height
|
|
35
36
|
ensure_complete!
|
|
36
|
-
@height = param(:overflow) ?
|
|
37
|
+
@height = param(:overflow) || !param(:wrap) ?
|
|
37
38
|
param(:height, calculate_height).to_d :
|
|
38
39
|
[param(:height, 0), calculate_height].max.to_d
|
|
39
40
|
end
|
|
@@ -104,7 +105,7 @@ module SvgDrawer
|
|
|
104
105
|
end
|
|
105
106
|
|
|
106
107
|
def lines
|
|
107
|
-
return [@text] if param(:overflow)
|
|
108
|
+
return [@text] if param(:overflow) || !param(:wrap)
|
|
108
109
|
txt = param(:truncate) ?
|
|
109
110
|
Utils::Text.truncate(@text, chars_per_line, param(:truncate_with)) :
|
|
110
111
|
@text
|
data/lib/svg_drawer/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: svg_drawer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Simeon Manolov
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-05-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rasem
|