Skip to content
This repository was archived by the owner on Feb 18, 2018. It is now read-only.

Commit f83e991

Browse files
committed
fix edit menu
1 parent 0945a1a commit f83e991

1 file changed

Lines changed: 17 additions & 10 deletions

File tree

src/plot.jl

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,14 @@ function is_editable(k, v_v)
9898
k == :instances ||
9999
k == Symbol("position.multiplicator") ||
100100
k == Symbol("position.dims") ||
101+
k == Symbol("spatialorder") ||
101102
k == Symbol("resolution") ||
102103
k == Symbol("fxaa") ||
103104
k == Symbol("light") ||
104105
k == Symbol("light") ||
105106
k == Symbol("doc_string") ||
106107
k == Symbol("faces") ||
108+
k == Symbol("image") ||
107109
k == Symbol("vertices") ||
108110
k == Symbol("texturecoordinates") ||
109111
k == Symbol("ranges") ||
@@ -157,17 +159,22 @@ function register_plot!(
157159
preserve(foldp((false, value(item_height)), edit_signal) do v0, edit
158160
if edit
159161
if !v0[1] # only do this at the first time
160-
vis, signal_dict = extract_edit_menu(
161-
to_edit_dict(robj),
162-
edit_item_screen,
163-
edit_signal,
164-
)
165-
for (k, v) in signal_dict
166-
robj.uniforms[k] = v
162+
dict = to_edit_dict(robj)
163+
nh = if !isempty(dict)
164+
vis, signal_dict = extract_edit_menu(
165+
dict,
166+
edit_item_screen,
167+
edit_signal,
168+
)
169+
for (k, v) in signal_dict
170+
robj.uniforms[k] = v
171+
end
172+
_view(vis, edit_item_screen, camera = :fixed_pixel)
173+
new_heights = widths(value(boundingbox(vis)))[2]
174+
ceil(Int, new_heights)
175+
else
176+
0
167177
end
168-
_view(vis, edit_item_screen, camera = :fixed_pixel)
169-
new_heights = widths(value(boundingbox(vis)))[2]
170-
nh = ceil(Int, new_heights)
171178
push!(item_height, nh)
172179
return true, nh
173180
else

0 commit comments

Comments
 (0)