Skip to content

Commit

Permalink
fix precompilation
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonDanisch committed Jul 22, 2023
1 parent 017372f commit dc205a1
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 22 deletions.
8 changes: 4 additions & 4 deletions CairoMakie/src/primitives.jl
Expand Up @@ -50,8 +50,8 @@ function draw_atomic(scene::Scene, screen::Screen, @nospecialize(primitive::Unio
Cairo.set_dash(ctx, pattern)
end

if primitive isa Lines && primitive.input_args[1][] isa BezierPath
return draw_bezierpath_lines(ctx, primitive.input_args[1][], scene, color, space, model, linewidth)
if primitive isa Lines && to_value(primitive.args[1]) isa BezierPath
return draw_bezierpath_lines(ctx, to_value(primitive.args[1]), scene, color, space, model, linewidth)
end

if color isa AbstractArray || linewidth isa AbstractArray
Expand Down Expand Up @@ -606,7 +606,7 @@ function draw_atomic(scene::Scene, screen::Screen, @nospecialize(primitive::Unio
t = Makie.transform_func(primitive)
identity_transform = (t === identity || t isa Tuple && all(x-> x === identity, t)) && (abs(model[1, 2]) < 1e-15)
regular_grid = xs isa AbstractRange && ys isa AbstractRange
xy_aligned = let
xy_aligned = let
# Only allow scaling and translation
pv = scene.camera.projectionview[]
M = Mat4f(
Expand Down Expand Up @@ -635,7 +635,7 @@ function draw_atomic(scene::Scene, screen::Screen, @nospecialize(primitive::Unio
xymax = project_position(scene, space, Point2f(last.(imsize)), model)
w, h = xymax .- xy

can_use_fast_path = !(is_vector && !interpolate) && regular_grid && identity_transform &&
can_use_fast_path = !(is_vector && !interpolate) && regular_grid && identity_transform &&
(interpolate || xy_aligned)
use_fast_path = can_use_fast_path && !disable_fast_path

Expand Down
2 changes: 1 addition & 1 deletion MakieCore/src/attributes.jl
Expand Up @@ -182,7 +182,7 @@ Base.get(x::AttributeOrPlot, key::Symbol, default) = get(()-> default, x, key)
# the plot itself.
Base.getindex(plot::AbstractPlot, idx::Integer) = plot.converted[idx]
Base.getindex(plot::AbstractPlot, idx::UnitRange{<:Integer}) = plot.converted[idx]
Base.setindex!(plot::AbstractPlot, value, idx::Integer) = (plot.input_args[idx][] = value)
Base.setindex!(plot::AbstractPlot, value, idx::Integer) = (plot.args[idx][] = value)
Base.length(plot::AbstractPlot) = length(plot.converted)

function Base.getindex(x::AbstractPlot, key::Symbol)
Expand Down
1 change: 0 additions & 1 deletion src/basic_recipes/axis.jl
Expand Up @@ -339,7 +339,6 @@ function plot!(axis::Axis3D)
Observable(textbuffer), Observable(linebuffer), scale(scene),
axis[1], axis.ticks.ranges_labels, Observable(axis.fonts), args...
)
push!(scene, axis)
return axis
end

Expand Down
26 changes: 11 additions & 15 deletions src/makielayout/blocks/axis3d.jl
Expand Up @@ -270,30 +270,26 @@ function projectionmatrix(viewmatrix, limits, eyepos, radius, azim, elev, angle,
end


function Makie.plot!(
ax::Axis3, P::Makie.PlotFunc,
attributes::Makie.Attributes, args...;
kw_attributes...)
function plot!(ax::Axis3, p::P) where P
# allattrs = merge(attributes, Attributes(kw_attributes))

allattrs = merge(attributes, Attributes(kw_attributes))
# _disallow_keyword(:axis, allattrs)
# _disallow_keyword(:figure, allattrs)

_disallow_keyword(:axis, allattrs)
_disallow_keyword(:figure, allattrs)
# cycle = get_cycle_for_plottype(allattrs, P)
# add_cycle_attributes!(allattrs, P, cycle, ax.cycler, ax.palette)

cycle = get_cycle_for_plottype(allattrs, P)
add_cycle_attributes!(allattrs, P, cycle, ax.cycler, ax.palette)

plot = Makie.plot!(ax.scene, P, allattrs, args...)
plot!(ax.scene, p)

if is_open_or_any_parent(ax.scene)
reset_limits!(ax)
end
plot
return p
end

function Makie.plot!(P::Makie.PlotFunc, ax::Axis3, args...; kw_attributes...)
attributes = Makie.Attributes(kw_attributes)
Makie.plot!(ax, P, attributes, args...)
function plot!(P::PlotFunc, ax::Axis3, args...; kw_attributes...)
attributes = Attributes(kw_attributes)
plot!(ax, P, attributes, args...)
end

function update_state_before_display!(ax::Axis3)
Expand Down
2 changes: 1 addition & 1 deletion test/pipeline.jl
Expand Up @@ -30,7 +30,7 @@ end
xmax = Observable{Any}([0.25, 0.5, 0.75, 1])

p = hlines!(ax, list, xmax = xmax, color = :blue)
@test getfield(p, :input_args)[1] === list
@test getfield(p, :args)[1] === list
@test p.xmax === xmax
fig
end

0 comments on commit dc205a1

Please sign in to comment.