refactors + rename from GLWindow
This commit is contained in:
parent
e24acece49
commit
22f12316ef
@ -122,7 +122,7 @@ function create_window(plt::Plot{GLVisualizeBackend}, visible)
|
|||||||
@async begin
|
@async begin
|
||||||
while isopen(screen)
|
while isopen(screen)
|
||||||
tic()
|
tic()
|
||||||
GLWindow.pollevents()
|
GLWindow.poll_glfw()
|
||||||
if Base.n_avail(Reactive._messages) > 0
|
if Base.n_avail(Reactive._messages) > 0
|
||||||
poll_reactive()
|
poll_reactive()
|
||||||
poll_reactive() # two times for secondary signals
|
poll_reactive() # two times for secondary signals
|
||||||
@ -458,7 +458,7 @@ function hover(to_hover, to_display, window)
|
|||||||
mini = minimum(bb)
|
mini = minimum(bb)
|
||||||
w = GeometryTypes.widths(bb)
|
w = GeometryTypes.widths(bb)
|
||||||
wborder = w * 0.08f0 #8 percent border
|
wborder = w * 0.08f0 #8 percent border
|
||||||
bb = GeometryTypes.AABB{Float32}(mini-wborder, w+2f0*wborder)
|
bb = GeometryTypes.AABB{Float32}(mini - wborder, w + 2 * wborder)
|
||||||
GLAbstraction.center!(cam, bb)
|
GLAbstraction.center!(cam, bb)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
@ -918,7 +918,6 @@ function _display(plt::Plot{GLVisualizeBackend}, visible = true)
|
|||||||
sw, sh = plt[:size]
|
sw, sh = plt[:size]
|
||||||
sw, sh = sw*px, sh*px
|
sw, sh = sw*px, sh*px
|
||||||
|
|
||||||
# TODO: use plt.subplots... plt.spmap can't be trusted
|
|
||||||
for sp in plt.subplots
|
for sp in plt.subplots
|
||||||
_3d = Plots.is3d(sp)
|
_3d = Plots.is3d(sp)
|
||||||
# camera = :perspective
|
# camera = :perspective
|
||||||
@ -1073,14 +1072,14 @@ function _display(plt::Plot{GLVisualizeBackend}, visible = true)
|
|||||||
if _3d
|
if _3d
|
||||||
GLAbstraction.center!(sp_screen)
|
GLAbstraction.center!(sp_screen)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
Reactive.post_empty()
|
Reactive.post_empty()
|
||||||
yield()
|
yield()
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function _show(io::IO, ::MIME"image/png", plt::Plot{GLVisualizeBackend})
|
function _show(io::IO, ::MIME"image/png", plt::Plot{GLVisualizeBackend})
|
||||||
_display(plt, false)
|
_display(plt, false)
|
||||||
GLWindow.pollevents()
|
GLWindow.poll_glfw()
|
||||||
if Base.n_avail(Reactive._messages) > 0
|
if Base.n_avail(Reactive._messages) > 0
|
||||||
Reactive.run_till_now()
|
Reactive.run_till_now()
|
||||||
end
|
end
|
||||||
@ -1328,7 +1327,6 @@ function make_label(sp, series, i)
|
|||||||
points = Point2f0[(0, ho), (w, ho)]
|
points = Point2f0[(0, ho), (w, ho)]
|
||||||
kw = KW()
|
kw = KW()
|
||||||
extract_linestyle(d, kw)
|
extract_linestyle(d, kw)
|
||||||
kw[:thickness] = 15f0
|
|
||||||
append!(result, GL.gl_lines(points, kw))
|
append!(result, GL.gl_lines(points, kw))
|
||||||
if d[:markershape] != :none
|
if d[:markershape] != :none
|
||||||
push!(result, label_scatter(d, w, ho))
|
push!(result, label_scatter(d, w, ho))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user