psd 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/psd/node.rb +5 -3
- data/lib/psd/nodes/search.rb +2 -1
- data/lib/psd/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f9c53ce033fdba16caf70bf522d538ced6658f4
|
4
|
+
data.tar.gz: bd3827fcd93cf3a44c517b8e76504e4b7302fad0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f5e146a36e2630d1833ab163dee71137cc469c46f2fbe6c766f2b170a182e33974cb911208c0fb7b9e9ffac62a97c764c07b6e9ba3eb77a5ab9459f72b01d395
|
7
|
+
data.tar.gz: 04f8f7140acfc9c972432723721603bc4650572e526bae647da386308b49a6fa734447149a945a6f1bbbd90e3428365cd280f4dbfd389d7c140784fc7e8a1b0e
|
data/lib/psd/node.rb
CHANGED
@@ -12,7 +12,7 @@ class PSD
|
|
12
12
|
# Default properties that all nodes contain
|
13
13
|
PROPERTIES = [:name, :left, :right, :top, :bottom, :height, :width]
|
14
14
|
|
15
|
-
attr_accessor :parent, :children, :layer
|
15
|
+
attr_accessor :parent, :children, :layer, :force_visible
|
16
16
|
|
17
17
|
def initialize(layers=[])
|
18
18
|
@children = []
|
@@ -20,14 +20,16 @@ class PSD
|
|
20
20
|
layer.parent = self
|
21
21
|
@children << layer
|
22
22
|
end
|
23
|
+
|
24
|
+
@force_visible = false
|
23
25
|
end
|
24
26
|
|
25
27
|
def hidden?
|
26
|
-
|
28
|
+
!visible?
|
27
29
|
end
|
28
30
|
|
29
31
|
def visible?
|
30
|
-
@layer.visible?
|
32
|
+
force_visible || @layer.visible?
|
31
33
|
end
|
32
34
|
|
33
35
|
def psd
|
data/lib/psd/nodes/search.rb
CHANGED
@@ -49,13 +49,14 @@ class PSD
|
|
49
49
|
node.children.select! do |c|
|
50
50
|
c
|
51
51
|
.metadata
|
52
|
-
.data[:layer_comp]['layerSettings'].map { |l| !l.has_key?('enab') || l['enab'] ? l['compList'] : nil }
|
52
|
+
.data[:layer_comp]['layerSettings'].map { |l| !l.has_key?('enab') || l['enab'] == true ? l['compList'] : nil }
|
53
53
|
.flatten
|
54
54
|
.compact
|
55
55
|
.include?(id)
|
56
56
|
end
|
57
57
|
|
58
58
|
node.children.each do |c|
|
59
|
+
c.force_visible = true
|
59
60
|
filter_for_comp!(id, c) if c.is_a?(PSD::Node::Group)
|
60
61
|
end
|
61
62
|
end
|
data/lib/psd/version.rb
CHANGED