fixes for GLVisualize
This commit is contained in:
parent
fdadfa3a80
commit
c93e2b80ca
@ -149,19 +149,20 @@ function get_plot_screen(screen, name, result = [])
|
|||||||
end
|
end
|
||||||
|
|
||||||
function create_window(plt::Plot{GLVisualizeBackend}, visible)
|
function create_window(plt::Plot{GLVisualizeBackend}, visible)
|
||||||
name = Symbol("Plots.jl")
|
name = Symbol("__Plots.jl")
|
||||||
# make sure we have any screen open
|
# make sure we have any screen open
|
||||||
if isempty(GLVisualize.get_screens())
|
if isempty(GLVisualize.get_screens())
|
||||||
# create a fresh, new screen
|
# create a fresh, new screen
|
||||||
parent_screen = GLVisualize.glscreen(
|
parent_screen = GLVisualize.glscreen(
|
||||||
"Plot",
|
"Plots",
|
||||||
resolution = plt[:size],
|
resolution = plt[:size],
|
||||||
visible = visible
|
visible = visible
|
||||||
)
|
)
|
||||||
@async GLWindow.waiting_renderloop(parent_screen)
|
@async GLWindow.waiting_renderloop(parent_screen)
|
||||||
|
GLVisualize.add_screen(parent_screen)
|
||||||
end
|
end
|
||||||
# now lets get ourselves a permanent Plotting screen
|
# now lets get ourselves a permanent Plotting screen
|
||||||
plot_screens = get_plot_screen(GLVisualize.get_screens(), name)
|
plot_screens = get_plot_screen(GLVisualize.current_screen(), name)
|
||||||
screen = if isempty(plot_screens) # no screen with `name`
|
screen = if isempty(plot_screens) # no screen with `name`
|
||||||
parent = GLVisualize.current_screen()
|
parent = GLVisualize.current_screen()
|
||||||
screen = GLWindow.Screen(
|
screen = GLWindow.Screen(
|
||||||
@ -177,7 +178,7 @@ function create_window(plt::Plot{GLVisualizeBackend}, visible)
|
|||||||
else
|
else
|
||||||
# okay this is silly! Lets see if we can. There is an ID we could use
|
# okay this is silly! Lets see if we can. There is an ID we could use
|
||||||
# will not be fine for more than 255 screens though -.-.
|
# will not be fine for more than 255 screens though -.-.
|
||||||
error("multiple Plot screens. Please don't use any screen with the name Plots.jl")
|
error("multiple Plot screens. Please don't use any screen with the name $name")
|
||||||
end
|
end
|
||||||
# Since we own this window, we can do deep cleansing
|
# Since we own this window, we can do deep cleansing
|
||||||
empty_screen!(screen)
|
empty_screen!(screen)
|
||||||
@ -1415,6 +1416,8 @@ function label_scatter(d, w, ho)
|
|||||||
color = get(kw, :color, nothing)
|
color = get(kw, :color, nothing)
|
||||||
kw[:color] = isa(color, Array) ? first(color) : color
|
kw[:color] = isa(color, Array) ? first(color) : color
|
||||||
end
|
end
|
||||||
|
strcolor = get(kw, :stroke_color, RGBA{Float32}(0,0,0,0))
|
||||||
|
kw[:stroke_color] = isa(strcolor, Array) ? first(strcolor) : strcolor
|
||||||
p = get(kw, :primitive, GeometryTypes.Circle)
|
p = get(kw, :primitive, GeometryTypes.Circle)
|
||||||
if isa(p, GLNormalMesh)
|
if isa(p, GLNormalMesh)
|
||||||
bb = GeometryTypes.AABB{Float32}(GeometryTypes.vertices(p))
|
bb = GeometryTypes.AABB{Float32}(GeometryTypes.vertices(p))
|
||||||
@ -1429,6 +1432,9 @@ function label_scatter(d, w, ho)
|
|||||||
kw[:scale] = Vec3f0(w/2)
|
kw[:scale] = Vec3f0(w/2)
|
||||||
delete!(kw, :offset)
|
delete!(kw, :offset)
|
||||||
end
|
end
|
||||||
|
if isa(p, Array)
|
||||||
|
kw[:primitive] = GeometryTypes.Circle
|
||||||
|
end
|
||||||
GL.gl_scatter(Point2f0[(w/2, ho)], kw)
|
GL.gl_scatter(Point2f0[(w/2, ho)], kw)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user