Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

float32 conversion #3663

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d8ada72
use proper float32 scaling (wip)
SimonDanisch Feb 29, 2024
3dca738
allow types to pass through PointBased conversion [prototyping]
ffreyer Mar 2, 2024
c9bbf5d
constants overwrite [prototyping]
ffreyer Mar 2, 2024
d5ab55c
Float64 boundingboxes/data_limits
ffreyer Mar 2, 2024
e7549a1
Float64 axis limits
ffreyer Mar 2, 2024
7eb0603
fix range step cannot be 0 (Float64 limits/ticks in lineaxis)
ffreyer Mar 2, 2024
795c6b7
prototype new version of Float scaling
ffreyer Mar 2, 2024
69e3d05
change model/transform_func to Float64
ffreyer Mar 3, 2024
6e68de5
add Float32Convert -> Mat4d conversion
ffreyer Mar 3, 2024
05756e9
get CairoMakie working
ffreyer Mar 3, 2024
1f8fcf3
move f32 cnversion to scene & prototype CairoMakie
ffreyer Mar 4, 2024
0dce2ce
rename and actually convert to Float32
ffreyer Mar 4, 2024
d2a2087
prototype GLMakie
ffreyer Mar 4, 2024
6ada066
Merge branch 'breaking-0.21' into sd/float32-conversion
ffreyer Mar 5, 2024
c692aaa
cleanup prints
ffreyer Mar 5, 2024
bcc4bdc
get lines working again
ffreyer Mar 5, 2024
af49f41
get GLMakie working + some interactivity
ffreyer Mar 5, 2024
c42a9c3
fix rect zoom
ffreyer Mar 5, 2024
bb6d675
fix typo
ffreyer Mar 5, 2024
5404890
disable old f32 conversion
ffreyer Mar 5, 2024
05c2705
hide most screens
ffreyer Mar 5, 2024
c662066
some test fixes
ffreyer Mar 5, 2024
9a5c4da
fix normalmatrix types
ffreyer Mar 5, 2024
c844ee2
Merge branch 'sd/axis-converts' into sd/float32-conversion
SimonDanisch Mar 6, 2024
764f37f
fix merge conflict
SimonDanisch Mar 6, 2024
738023f
Streamline data_limits and boundingbox (#3671)
ffreyer Mar 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
- Remove StableHashTraits in favor of calculating hashes directly with CRC32c [#3667](https://github.com/MakieOrg/Makie.jl/pull/3667).
- **Breaking (sort of)** Added a new `@recipe` variant which allows documenting attributes directly where they are defined and validating that all attributes are known whenever a plot is created. This is not breaking in the sense that the API changes, but user code is likely to break because of misspelled attribute names etc. that have so far gone unnoticed.
- Add axis converts, enabling unit/categorical support and more [#3226](https://github.com/MakieOrg/Makie.jl/pull/3226).
- **Breaking** Streamline `data_limits` and `boundingbox` [#3671](https://github.com/MakieOrg/Makie.jl/pull/3671)
- `data_limits` now only considers plot positions, completely ignoring transformations
- `boundingbox(::Text)` is deprecated in favor of `text_boundingbox(::Text)`
- `boundingbox` now always consider `transform_func` and `model` (except for Text for the time being)
- **Breaking** Reworked line shaders in GLMakie and WGLMakie [#3558](https://github.com/MakieOrg/Makie.jl/pull/3558)
- GLMakie: Removed support for per point linewidths
- GLMakie: Adjusted dots (e.g. with `linestyle = :dot`) to bend across a joint
Expand All @@ -17,6 +21,7 @@
- Both: Adjusted handling of thin lines which may result in different color intensities
- Fixed an issue with lines being drawn in the wrong direction in 3D (with perspective projection) [#3651](https://github.com/MakieOrg/Makie.jl/pull/3651).


## [0.20.8] - 2024-02-22

- Fixed excessive use of space with HTML image outputs [#3642](https://github.com/MakieOrg/Makie.jl/pull/3642).
Expand Down
1 change: 1 addition & 0 deletions CairoMakie/src/CairoMakie.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ using Makie: to_value, to_colormap, extrema_nan
using Makie.Observables
using Makie: spaces, is_data_space, is_pixel_space, is_relative_space, is_clip_space
using Makie: numbers_to_colors
using Makie: Mat3f, Mat4f, Mat3d, Mat4d

# re-export Makie, including deprecated names
for name in names(Makie, all=true)
Expand Down
26 changes: 14 additions & 12 deletions CairoMakie/src/primitives.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ function draw_atomic(scene::Scene, screen::Screen, @nospecialize(primitive::Unio
# Standard transform from input space to clip space
points = Makie.apply_transform(Makie.transform_func(primitive), positions, space)
res = scene.camera.resolution[]
transform = Makie.space_to_clip(scene.camera, space) * model
clip_points = map(p -> transform * to_ndim(Vec4f, to_ndim(Vec3f, p, 0f0), 1f0), points)

f32convert = Makie.f32_convert_matrix(scene.float32convert, space)
transform = Makie.space_to_clip(scene.camera, space) * model * f32convert
clip_points = map(p -> transform * to_ndim(Vec4d, to_ndim(Vec3d, p, 0), 1), points)

# yflip and clip -> screen/pixel coords
function clip2screen(res, p)
Expand Down Expand Up @@ -374,7 +376,7 @@ function draw_atomic(scene::Scene, screen::Screen, @nospecialize(primitive::Scat
model = primitive.model[]
positions = primitive[1][]
isempty(positions) && return
size_model = transform_marker ? model : Mat4f(I)
size_model = transform_marker ? model : Mat4d(I)

font = to_font(to_value(get(primitive, :font, Makie.defaultfont())))

Expand Down Expand Up @@ -630,7 +632,7 @@ function draw_glyph_collection(
strokecolors = glyph_collection.strokecolors

model = _deref(_model)
model33 = transform_marker ? model[Vec(1, 2, 3), Vec(1, 2, 3)] : Mat3f(I)
model33 = transform_marker ? model[Vec(1, 2, 3), Vec(1, 2, 3)] : Mat3d(I)
id = Mat4f(I)

glyph_pos = let
Expand All @@ -639,7 +641,7 @@ function draw_glyph_collection(

Makie.clip_to_space(scene.camera, markerspace) *
Makie.space_to_clip(scene.camera, space) *
model * to_ndim(Point4f, to_ndim(Point3f, p, 0), 1)
model * to_ndim(Point4d, to_ndim(Point3d, p, 0), 1)
end

Cairo.save(ctx)
Expand Down Expand Up @@ -674,8 +676,8 @@ function draw_glyph_collection(
# origin. The resulting vectors give the directions in which the character
# needs to be stretched in order to match the 3D projection

xvec = rotation * (scale3[1] * Point3f(1, 0, 0))
yvec = rotation * (scale3[2] * Point3f(0, -1, 0))
xvec = rotation * (scale3[1] * Point3d(1, 0, 0))
yvec = rotation * (scale3[2] * Point3d(0, -1, 0))

glyphpos = _project_position(scene, markerspace, gp3, id, true)
xproj = _project_position(scene, markerspace, gp3 + model33 * xvec, id, true)
Expand Down Expand Up @@ -767,7 +769,7 @@ function draw_atomic(scene::Scene, screen::Screen, @nospecialize(primitive::Unio
else
ys = regularly_spaced_array_to_range(ys)
end
model = primitive.model[]::Mat4f
model = primitive.model[]::Mat4d
interpolate = to_value(primitive.interpolate)

# Debug attribute we can set to disable fastpath
Expand Down Expand Up @@ -901,10 +903,10 @@ function draw_atomic(scene::Scene, screen::Screen, @nospecialize(primitive::Maki
end

function draw_mesh2D(scene, screen, @nospecialize(plot), @nospecialize(mesh))
vs = decompose(Point2f, mesh)::Vector{Point2f}
vs = decompose(Point2f, mesh)::Vector{Point2f}
fs = decompose(GLTriangleFace, mesh)::Vector{GLTriangleFace}
uv = decompose_uv(mesh)::Union{Nothing, Vector{Vec2f}}
model = plot.model[]::Mat4f
model = plot.model[]::Mat4d
color = hasproperty(mesh, :color) ? to_color(mesh.color) : plot.calculated_colors[]
cols = per_face_colors(color, nothing, fs, nothing, uv)
space = to_value(get(plot, :space, :data))::Symbol
Expand Down Expand Up @@ -971,7 +973,7 @@ function draw_mesh3D(scene, screen, attributes, mesh; pos = Vec4f(0), scale = 1f

per_face_col = per_face_colors(color, matcap, meshfaces, meshnormals, meshuvs)

model = attributes.model[]::Mat4f
model = attributes.model[]::Mat4d
space = to_value(get(attributes, :space, :data))::Symbol
func = Makie.transform_func(attributes)

Expand Down Expand Up @@ -1003,7 +1005,7 @@ function draw_mesh3D(
i = Vec(1, 2, 3)
normalmatrix = transpose(inv(model[i, i]))

local_model = rotation * Makie.scalematrix(Vec3f(scale))
local_model = rotation * Makie.scalematrix(Vec3d(scale))
# pass transform_func as argument to function, so that we get a function barrier
# and have `transform_func` be fully typed inside closure
vs = broadcast(meshpoints, (transform_func,)) do v, f
Expand Down
39 changes: 32 additions & 7 deletions CairoMakie/src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,35 @@ function project_position(scene::Scene, transform_func::T, space, point, model::
_project_position(scene, space, point, model, yflip)
end

function _project_position(scene::Scene, space, point, model, yflip::Bool)
# much faster than dot-ing `project_position` because it skips all the repeated mat * mat
function _project_position(scene::Scene, space, ps::Vector{<: VecTypes{N, T1}}, model, yflip::Bool) where {N, T1}
transform = let
f32convert = Makie.f32_convert_matrix(scene.float32convert, space)
M = Makie.space_to_clip(scene.camera, space) * model * f32convert
res = scene.camera.resolution[]
px_scale = Vec3d(0.5 * res[1], 0.5 * (yflip ? -res[2] : res[2]), 1)
px_offset = Vec3d(0.5 * res[1], 0.5 * res[2], 0)
M = Makie.transformationmatrix(px_offset, px_scale) * M
M[Vec(1,2,4), Vec(1,2,3,4)] # skip z, i.e. calculate (x, y, w)
end

output = similar(ps, Point2f)

@inbounds for i in eachindex(ps)
p4d = to_ndim(Point4d, to_ndim(Point3d, ps[i], 0), 1)
px_pos = transform * p4d
output[i] = px_pos[Vec(1, 2)] / px_pos[3]
end

return output
end

function _project_position(scene::Scene, space, point::VecTypes{N, T1}, model, yflip::Bool) where {N, T1}
T = promote_type(Float32, T1) # always Float, at least Float32
res = scene.camera.resolution[]
p4d = to_ndim(Vec4f, to_ndim(Vec3f, point, 0f0), 1f0)
clip = Makie.space_to_clip(scene.camera, space) * model * p4d
p4d = to_ndim(Vec4{T}, to_ndim(Vec3{T}, point, 0), 1)
f32convert = Makie.f32_convert_matrix(scene.float32convert, space)
clip = Makie.space_to_clip(scene.camera, space) * model * f32convert * p4d
@inbounds begin
# between -1 and 1
p = (clip ./ clip[4])[Vec(1, 2)]
Expand All @@ -29,12 +54,12 @@ function project_position(@nospecialize(scenelike), space, point, model, yflip::
project_position(scene, Makie.transform_func(scenelike), space, point, model, yflip)
end

function project_scale(scene::Scene, space, s::Number, model = Mat4f(I))
project_scale(scene, space, Vec2f(s), model)
function project_scale(scene::Scene, space, s::Number, model = Mat4d(I))
project_scale(scene, space, Vec2d(s), model)
end

function project_scale(scene::Scene, space, s, model = Mat4f(I))
p4d = model * to_ndim(Vec4f, s, 0f0)
function project_scale(scene::Scene, space, s, model = Mat4d(I))
p4d = model * to_ndim(Vec4d, s, 0)
if is_data_space(space)
@inbounds p = (scene.camera.projectionview[] * p4d)[Vec(1, 2)]
return p .* scene.camera.resolution[] .* 0.5
Expand Down
87 changes: 64 additions & 23 deletions GLMakie/src/drawing_primitives.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,15 @@ function connect_camera!(plot, gl_attributes, cam, space = gl_attributes[:space]
get!(gl_attributes, :world_normalmatrix) do
return lift(plot, gl_attributes[:model]) do m
i = Vec(1, 2, 3)
return transpose(inv(m[i, i]))
return Mat3f(transpose(inv(m[i, i])))
end
end

# for SSAO
get!(gl_attributes, :view_normalmatrix) do
return lift(plot, gl_attributes[:view], gl_attributes[:model]) do v, m
i = Vec(1, 2, 3)
return transpose(inv(v[i, i] * m[i, i]))
return Mat3f(transpose(inv(v[i, i] * m[i, i])))
end
end
get!(gl_attributes, :projection) do
Expand Down Expand Up @@ -221,6 +221,33 @@ function get_space(x)
return haskey(x, :markerspace) ? x.markerspace : x.space
end

# TODO consider mirroring f32convert to plot attributes
function apply_transform_and_f32_conversion(
scene::Scene, plot::AbstractPlot, data,
space::Observable = get(plot, :space, Observable(:data))
)
f32c_obs = isnothing(scene.float32convert) ? Observable(nothing) : scene.float32convert.scaling
return map(plot, f32c_obs, transform_func_obs(plot), data, space) do _, _tf, data, space
tf = space == :data ? _tf : identity
f32c = space in (:data, :transformed) ? scene.float32convert : nothing
# avoid intermediate array?
return [Makie.f32_convert(f32c, apply_transform(tf, x)) for x in data]
end
end

# For Vector{<: Real} applying to x/y/z dimension
function apply_transform_and_f32_conversion(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we still may want a Float32Projection <: PointTransform type, and then create one of those per scene, and apply them directly in drawing_primitives.jl, like this

function cached_robj!(robj_func, screen, scene, plot::AbstractPlot)
    ...
    transform = Float32Transform(scene.f32convert) 
    gl_attributes[:transform] = transform 
    ....
    
end

function draw_atomic(screen::Screen, scene::Scene, ::Scatter)
    return cached_robj!(screen, scene, plot) do gl_attributes
        space = plot.space
        positions = handle_view(plot[1], gl_attributes)
        transform_func_obs = gl_attributes[:transform]
        # Leave all the transform func lifts, just change them coming from `plot` to `gl_attributes`:
        positions = lift(apply_transform, plot, transform_func_obs, positions, space)
        ...
    end
end

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't that override the plot's native transform_func, though?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We wouldn't want to replace existing transform_func's though, would we?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I guess I meant:

transform = Float32Transform(scene.f32convert, plot.transform)) 

And then in apply_transform do the heavy lifting and apply the original transform...
We should not overwrite the plot.transform, that's why I put it in gl_attributes

scene::Scene, plot::AbstractPlot, data, dim::Integer,
space::Observable = get(plot, :space, Observable(:data))
)
f32c_obs = isnothing(scene.float32convert) ? Observable(nothing) : scene.float32convert.scaling
return map(plot, f32c_obs, transform_func_obs(plot), data, space) do _, _tf, data, space
tf = space == :data ? _tf : identity
f32c = space in (:data, :transformed) ? scene.float32convert : nothing
return [Makie.f32_convert(f32c, apply_transform(tf, x), dim) for x in data]
asinghvi17 marked this conversation as resolved.
Show resolved Hide resolved
end
end

const EXCLUDE_KEYS = Set([:transformation, :tickranges, :ticklabels, :raw, :SSAO,
:lightposition, :material, :axis_cycler,
:inspector_label, :inspector_hover, :inspector_clear, :inspectable,
Expand Down Expand Up @@ -382,7 +409,8 @@ function draw_atomic(screen::Screen, scene::Scene, @nospecialize(plot::Union{Sca

space = plot.space
positions = handle_view(plot[1], gl_attributes)
positions = lift(apply_transform, plot, transform_func_obs(plot), positions, space)
positions = apply_transform_and_f32_conversion(scene, plot, positions)
# positions = lift(apply_transform, plot, transform_func_obs(plot), positions, space)

if plot isa Scatter
mspace = plot.markerspace
Expand Down Expand Up @@ -444,20 +472,25 @@ function draw_atomic(screen::Screen, scene::Scene, @nospecialize(plot::Lines))
data = Dict{Symbol, Any}(gl_attributes)
positions = handle_view(plot[1], data)

transform_func = transform_func_obs(plot)
space = plot.space
if isnothing(to_value(linestyle))
data[:pattern] = nothing
data[:fast] = true

positions = lift(apply_transform, plot, transform_func, positions, space)
# positions = lift(apply_transform, plot, transform_func, positions, space)
positions = apply_transform_and_f32_conversion(scene, plot, positions)
else
data[:pattern] = linestyle
data[:fast] = false

pvm = lift(*, plot, data[:projectionview], data[:model])
positions = lift(plot, transform_func, positions, space, pvm) do f, ps, space, pvm
transformed = apply_transform(f, ps, space)
transform_func = transform_func_obs(plot)
f32c = scene.float32convert
f32c_obs = f32c isa Makie.Float32Convert ? f32c.scaling : Observable(nothing)
positions = lift(plot, f32c_obs, transform_func, positions,
space, pvm) do _, f, ps, space, pvm

transformed = Makie.f32_convert(f32c, apply_transform(f, ps, space), space)
output = Vector{Point4f}(undef, length(transformed))
for i in eachindex(transformed)
output[i] = pvm * to_ndim(Point4f, to_ndim(Point3f, transformed[i], 0f0), 1f0)
Expand All @@ -480,7 +513,8 @@ function draw_atomic(screen::Screen, scene::Scene, @nospecialize(plot::LineSegme
data[:pattern] = pop!(data, :linestyle)

positions = handle_view(plot[1], data)
positions = lift(apply_transform, plot, transform_func_obs(plot), positions, plot.space)
# positions = lift(apply_transform, plot, transform_func_obs(plot), positions, plot.space)
positions = apply_transform_and_f32_conversion(scene, plot, positions)
if haskey(data, :intensity)
data[:color] = pop!(data, :intensity)
end
Expand All @@ -489,11 +523,14 @@ function draw_atomic(screen::Screen, scene::Scene, @nospecialize(plot::LineSegme
end
end

# TODO: Float32 convert
function draw_atomic(screen::Screen, scene::Scene,
plot::Text{<:Tuple{<:Union{<:Makie.GlyphCollection, <:AbstractVector{<:Makie.GlyphCollection}}}})
return cached_robj!(screen, scene, plot) do gl_attributes
glyphcollection = plot[1]

f32c = scene.float32convert
f32c_obs = f32c isa Makie.Float32Convert ? f32c.scaling : Observable(nothing)
transfunc = Makie.transform_func_obs(plot)
pos = gl_attributes[:position]
space = plot.space
Expand All @@ -502,8 +539,8 @@ function draw_atomic(screen::Screen, scene::Scene,
atlas = gl_texture_atlas()

# calculate quad metrics
glyph_data = lift(plot, pos, glyphcollection, offset, transfunc, space) do pos, gc, offset, transfunc, space
return Makie.text_quads(atlas, pos, to_value(gc), offset, transfunc, space)
glyph_data = lift(plot, pos, glyphcollection, offset, f32c_obs, transfunc, space) do pos, gc, offset, _, transfunc, space
return Makie.text_quads(atlas, pos, to_value(gc), offset, f32c, transfunc, space)
end

# unpack values from the one signal:
Expand Down Expand Up @@ -576,20 +613,22 @@ function draw_atomic(screen::Screen, scene::Scene, plot::Heatmap)
t = Makie.transform_func_obs(plot)
mat = plot[3]
space = plot.space # needs to happen before connect_camera! call
xypos = lift(plot, t, plot[1], plot[2], space) do t, x, y, space
f32c = scene.float32convert
f32c_obs = f32c isa Makie.Float32Convert ? f32c.scaling : Observable(nothing)
xypos = lift(plot, f32c_obs, t, plot[1], plot[2], space) do _, t, x, y, space
x1d = xy_convert(x, size(mat[], 1))
y1d = xy_convert(y, size(mat[], 2))
# Only if transform doesn't do anything, we can stay linear in 1/2D
if Makie.is_identity_transform(t)
return (x1d, y1d)
return (Makie.f32_convert(f32c, x1d, 1), Makie.f32_convert(f32c, y1d, 2))
else
# If we do any transformation, we have to assume things aren't on the grid anymore
# so x + y need to become matrices.
map!(x1d, x1d) do x
return apply_transform(t, Point(x, 0), space)[1]
return Makie.f32_convert(f32c, apply_transform(t, Point(x, 0), space)[1], 1)
end
map!(y1d, y1d) do y
return apply_transform(t, Point(0, y), space)[2]
return Makie.f32_convert(f32c, apply_transform(t, Point(0, y), space)[2], 2)
end
return (x1d, y1d)
end
Expand Down Expand Up @@ -621,9 +660,9 @@ function draw_atomic(screen::Screen, scene::Scene, plot::Image)
xmin, xmax = extrema(x)
ymin, ymax = extrema(y)
rect = Rect2f(xmin, ymin, xmax - xmin, ymax - ymin)
return decompose(Point2f, rect)
return decompose(Point2d, rect)
end
gl_attributes[:vertices] = lift(apply_transform, plot, transform_func_obs(plot), position, plot.space)
gl_attributes[:vertices] = apply_transform_and_f32_conversion(scene, plot, position)
rect = Rect2f(0, 0, 1, 1)
gl_attributes[:faces] = decompose(GLTriangleFace, rect)
gl_attributes[:texturecoordinates] = map(decompose_uv(rect)) do uv
Expand Down Expand Up @@ -679,9 +718,9 @@ function mesh_inner(screen::Screen, mesh, transfunc, gl_attributes, plot, space=
gl_attributes[:color] = nothing
end

gl_attributes[:vertices] = lift(transfunc, mesh, space) do t, mesh, space
apply_transform(t, metafree(coordinates(mesh)), space)
end
# TODO: avoid intermediate observable
positions = map(m -> metafree(coordinates(m)), mesh)
gl_attributes[:vertices] = apply_transform_and_f32_conversion(Makie.parent_scene(plot), plot, positions)
gl_attributes[:faces] = lift(x-> decompose(GLTriangleFace, x), mesh)
if hasproperty(to_value(mesh), :uv)
gl_attributes[:texturecoordinates] = lift(decompose_uv, mesh)
Expand Down Expand Up @@ -734,18 +773,20 @@ function draw_atomic(screen::Screen, scene::Scene, plot::Surface)

if all(T -> T <: Union{AbstractMatrix, AbstractVector}, types)
t = Makie.transform_func_obs(plot)
f32c = scene.float32convert
f32c_obs = f32c isa Makie.Float32Convert ? f32c.scaling : Observable(nothing)
mat = plot[3]
xypos = lift(plot, t, plot[1], plot[2], space) do t, x, y, space
xypos = lift(plot, f32c_obs, t, plot[1], plot[2], space) do f32c_inner, t, x, y, space
# Only if transform doesn't do anything, we can stay linear in 1/2D
if Makie.is_identity_transform(t)
if Makie.is_identity_transform(t) && isnothing(f32c_inner)
return (x, y)
else
matrix = if x isa AbstractMatrix && y isa AbstractMatrix
apply_transform.((t,), Point.(x, y), space)
Makie.f32_convert(f32c, apply_transform.((t,), Point.(x, y), space), space)
else
# If we do any transformation, we have to assume things aren't on the grid anymore
# so x + y need to become matrices.
[apply_transform(t, Point(x, y), space) for x in x, y in y]
[Makie.f32_convert(f32c, apply_transform(t, Point(x, y), space), space) for x in x, y in y]
end
return (first.(matrix), last.(matrix))
end
Expand Down
2 changes: 1 addition & 1 deletion GLMakie/test/glmakie_refimages.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ end
end
end
fig, ax, meshplot = meshscatter(RNG.rand(Point3f, 10^4) .* 20f0; color=:black)
screen = display(GLMakie.Screen(;renderloop=(screen) -> nothing, start_renderloop=false), fig.scene)
screen = display(GLMakie.Screen(;renderloop=(screen) -> nothing, start_renderloop=false, visible=false), fig.scene)
buff = RNG.rand(Point3f, 10^4) .* 20f0;
update_loop(meshplot, buff, screen)
@test isnothing(screen.rendertask)
Expand Down
Loading