Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
de289d4
avoiding boxing in observable.jl
hz-xiaxz Jan 1, 2026
cf6c10b
change tail recursion to while loop to avoid boxing
hz-xiaxz Jan 1, 2026
f89bacc
avoid viewport boxing in scene
hz-xiaxz Jan 1, 2026
3ad1fe1
avoid name conflict boxing
hz-xiaxz Jan 1, 2026
8f4a2d9
avoid name conflict boxing
hz-xiaxz Jan 1, 2026
16501b2
rename multiple variables to avoid boxing
hz-xiaxz Jan 1, 2026
3472c2b
rename multiple variables to avoid boxing
hz-xiaxz Jan 1, 2026
2577d05
rename multiple 15:22:59 up 1:29, 1 user, load average: 1.00, 1.2…
hz-xiaxz Jan 1, 2026
0584aec
use Ref to avoid boxing in datashader. Shall we change to for loop here?
hz-xiaxz Jan 1, 2026
fad4a11
use if end to avoid pvmf32 boxing
hz-xiaxz Jan 1, 2026
8b9eaac
use multiple varibles to avoid lplots, labels boxing
hz-xiaxz Jan 1, 2026
36c64c9
tweak function definition order for relayout unboxing
hz-xiaxz Jan 1, 2026
7087c7f
fix boxing
hz-xiaxz Jan 1, 2026
81d88f7
use Ref, and remove unnecessary i
hz-xiaxz Jan 1, 2026
737e3b9
rename N->N_raw
hz-xiaxz Jan 1, 2026
a009b9e
add local to local function
hz-xiaxz Jan 1, 2026
921cfa1
rename variables in do block
hz-xiaxz Jan 1, 2026
9c097a9
local x1,y1,x2,y2
hz-xiaxz Jan 1, 2026
7e9f19c
raise nanpoint to _nanpoint to avoid boxing
hz-xiaxz Jan 1, 2026
1285e7a
use explicit for instead map to avoid boxing and improve performance(?)
hz-xiaxz Jan 1, 2026
2ef5e05
snapshot current_ind
hz-xiaxz Jan 1, 2026
86bdd2c
override Base.print, instead of defining local dispatched fn
hz-xiaxz Jan 1, 2026
2e738e2
fix boxing, fall back to p.voxel_color[] when Voxel textures are not …
hz-xiaxz Jan 1, 2026
64ab640
add local
hz-xiaxz Jan 1, 2026
89eadac
fix boxing
hz-xiaxz Jan 1, 2026
abd3608
add _ray_transform_point function and refactor ray triangle intersect…
hz-xiaxz Jan 1, 2026
21eaf4a
add ref to bb
hz-xiaxz Jan 1, 2026
e087909
rename to tfontsize_raw
hz-xiaxz Jan 1, 2026
161816d
rename to computed_labels
hz-xiaxz Jan 1, 2026
4e398e6
refactor: replace _transform_point with _ray_transform_point in ray i…
hz-xiaxz Jan 1, 2026
2307510
runic format
hz-xiaxz Jan 1, 2026
59cb3c2
use manual for loop to simplify logic
hz-xiaxz Jan 2, 2026
66dd3b2
fix
hz-xiaxz Jan 2, 2026
9fa226d
refactor: improve buffer handling in plot function for TimeSeries
hz-xiaxz Jan 2, 2026
b94451e
refactor: change tick_state to a reference for on_demand_renderloop
hz-xiaxz Jan 2, 2026
0c34bf9
unbox luma_id
hz-xiaxz Jan 2, 2026
9e7755b
Revert "unbox luma_id"
hz-xiaxz Jan 2, 2026
da37b52
check to @lock to avoid boxing
hz-xiaxz Jan 2, 2026
b2bbb61
fix
hz-xiaxz Jan 2, 2026
1b895e9
fix all GLMakie boxing
hz-xiaxz Jan 2, 2026
77b164d
fix all boxes in CairoMakie
hz-xiaxz Jan 2, 2026
7039c85
update
hz-xiaxz Jan 2, 2026
a958947
fix all boxing in WGLMakie
hz-xiaxz Jan 2, 2026
05489e0
fix all ComputePipeline boxing
hz-xiaxz Jan 2, 2026
32e822f
Merge remote-tracking branch 'upstream/master' into feature/avoid-box…
hz-xiaxz Jan 4, 2026
8259447
fix f32c_model appling twice
hz-xiaxz Jan 5, 2026
f5c0ed9
cleanup poly
ffreyer Jan 7, 2026
71d1c73
Merge branch 'master' into feature/avoid-boxes-optimizations
ffreyer Feb 2, 2026
b862369
eliminate box by changing to equivalent expression
hz-xiaxz Feb 17, 2026
a48c47b
move calculate_polys! out
hz-xiaxz Feb 17, 2026
787c858
check to @lock
hz-xiaxz Feb 17, 2026
9757ff3
define an outer function to be called in invokelatest()
hz-xiaxz Feb 17, 2026
889c33e
move private function
hz-xiaxz Feb 17, 2026
dc09e5c
Merge branch 'xxz/fix-text-layout' into feature/avoid-boxes-optimizat…
hz-xiaxz Feb 17, 2026
8531bc1
avoid map
hz-xiaxz Feb 17, 2026
fe9436a
move private function
hz-xiaxz Feb 17, 2026
f8321b5
move private function
hz-xiaxz Feb 17, 2026
0b2b25e
use Ref
hz-xiaxz Feb 17, 2026
4444495
move private function outside
hz-xiaxz Feb 17, 2026
ef73e95
Ref
hz-xiaxz Feb 17, 2026
fd7cee7
move private function
hz-xiaxz Feb 17, 2026
d2ce55a
move
hz-xiaxz Feb 17, 2026
5f6a5d7
move function
hz-xiaxz Feb 17, 2026
a03af53
move function
hz-xiaxz Feb 17, 2026
c156fcf
move function
hz-xiaxz Feb 17, 2026
3c1af5e
move function, I dont really see why this is boxed but jetls reports …
hz-xiaxz Feb 17, 2026
47f4e79
move
hz-xiaxz Feb 17, 2026
1be3293
add _dimsym1 and _dimsym2
hz-xiaxz Feb 17, 2026
426a0fe
move
hz-xiaxz Feb 17, 2026
7e63f52
move and pass global values
hz-xiaxz Feb 17, 2026
d9edcd6
move and pass global values
hz-xiaxz Feb 17, 2026
4207fac
move functions
hz-xiaxz Feb 17, 2026
4053e43
fix
hz-xiaxz Feb 17, 2026
40680af
move
hz-xiaxz Feb 17, 2026
29c4be3
ref
hz-xiaxz Feb 17, 2026
28682bd
move
hz-xiaxz Feb 17, 2026
0680978
update
hz-xiaxz Feb 17, 2026
785f733
update
hz-xiaxz Feb 17, 2026
687f314
update
hz-xiaxz Feb 17, 2026
ee37e79
update
hz-xiaxz Feb 17, 2026
e0d4c0e
update
hz-xiaxz Feb 17, 2026
ea9a656
update
hz-xiaxz Feb 17, 2026
0b4ec55
update
hz-xiaxz Feb 17, 2026
9202603
runic run
hz-xiaxz Feb 17, 2026
90198b7
update
hz-xiaxz Feb 17, 2026
ce6b2c3
Fix variable name in _update_plotlist function
hz-xiaxz Feb 18, 2026
fc5e85a
remove unused attribute_per_char
ffreyer Feb 23, 2026
50856ed
adjust some names
ffreyer Feb 23, 2026
6441661
Merge branch 'master' into feature/avoid-boxes-optimizations
ffreyer Feb 23, 2026
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
4 changes: 2 additions & 2 deletions ComputePipeline/src/ComputePipeline.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@

Inputs can be Symbols referring to compute nodes in `compute_graph`, or compute
nodes from any graph. These can also be mixed. Outputs are always Symbols naming
the new nodes generated by this functon.

Check failure on line 1024 in ComputePipeline/src/ComputePipeline.jl

View workflow job for this annotation

GitHub Actions / check

functon ==> function

The callback function `f` will be called with the values of the inputs as arguments.
If the output is a `::Symbol`, the function is expected to return a value, otherwise
Expand Down Expand Up @@ -1168,9 +1168,9 @@
while isopen(input_channel)
try
# Take the first item (blocking if empty)
inputs = take_last!(input_channel; wait = true)
fetched_inputs = take_last!(input_channel; wait = true)
# Process the most recent inputs
result = f(inputs...)
result = f(fetched_inputs...)
# Put result in the result channel
put!(result_channel, result)
# Notify that we got a new value, for the below computation to run
Expand Down
2 changes: 1 addition & 1 deletion GLMakie/src/GLAbstraction/GLAbstraction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function with_context(f, context)
error("Context is not alive anymore!")
end
old_ctx = nothing
lock(CONTEXT_LOCK1) do
@lock CONTEXT_LOCK1 begin
CTX = ShaderAbstractions.ACTIVE_OPENGL_CONTEXT
old_ctx = isassigned(CTX) ? CTX[] : nothing
ShaderAbstractions.switch_context!(context)
Expand Down
4 changes: 2 additions & 2 deletions GLMakie/src/glshaders/visualize_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ Grid(ranges::AbstractRange...) = Grid(ranges)
function Grid(a::Array{T, N}) where {N, T}
s = Vec{N, Float32}(size(a))
smax = maximum(s)
s = s ./ smax
s_normal = s ./ smax
return Grid(
ntuple(Val{N}) do i
range(0, stop = s[i], length = size(a, i))
range(0, stop = s_normal[i], length = size(a, i))
end
)
end
Expand Down
106 changes: 55 additions & 51 deletions GLMakie/src/postprocessing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -155,44 +155,46 @@ function ssao_postprocessor(framebuffer, shader_cache)
pass2.postrenderfunction = () -> draw_fullscreen(pass2.vertexarray.id)
color_id = framebuffer[:color][1]

full_render = screen -> begin
fb = screen.framebuffer
w, h = size(fb)

# Setup rendering
# SSAO - calculate occlusion
glDrawBuffer(normal_occ_id) # occlusion buffer
glViewport(0, 0, w, h)
glEnable(GL_SCISSOR_TEST)
ppu = (x) -> round.(Int, screen.px_per_unit[] .* x)

for (screenid, scene) in screen.screens
# Select the area of one leaf scene
# This should be per scene because projection may vary between
# scenes. It should be a leaf scene to avoid repeatedly shading
# the same region (though this is not guaranteed...)
isempty(scene.children) || continue
a = viewport(scene)[]
glScissor(ppu(minimum(a))..., ppu(widths(a))...)
# update uniforms
data1[:projection] = Mat4f(scene.camera.projection[])
data1[:bias] = scene.ssao.bias[]
data1[:radius] = scene.ssao.radius[]
GLAbstraction.render(pass1)
end

# SSAO - blur occlusion and apply to color
glDrawBuffer(color_id) # color buffer
for (screenid, scene) in screen.screens
# Select the area of one leaf scene
isempty(scene.children) || continue
a = viewport(scene)[]
glScissor(ppu(minimum(a))..., ppu(widths(a))...)
# update uniforms
data2[:blur_range] = scene.ssao.blur
GLAbstraction.render(pass2)
full_render = let normal_occ_id = normal_occ_id
screen -> begin
fb = screen.framebuffer
w, h = size(fb)

# Setup rendering
# SSAO - calculate occlusion
glDrawBuffer(normal_occ_id) # occlusion buffer
glViewport(0, 0, w, h)
glEnable(GL_SCISSOR_TEST)
ppu = (x) -> round.(Int, screen.px_per_unit[] .* x)

for (screenid, scene) in screen.screens
# Select the area of one leaf scene
# This should be per scene because projection may vary between
# scenes. It should be a leaf scene to avoid repeatedly shading
# the same region (though this is not guaranteed...)
isempty(scene.children) || continue
a = viewport(scene)[]
glScissor(ppu(minimum(a))..., ppu(widths(a))...)
# update uniforms
data1[:projection] = Mat4f(scene.camera.projection[])
data1[:bias] = scene.ssao.bias[]
data1[:radius] = scene.ssao.radius[]
GLAbstraction.render(pass1)
end

# SSAO - blur occlusion and apply to color
glDrawBuffer(color_id) # color buffer
for (screenid, scene) in screen.screens
# Select the area of one leaf scene
isempty(scene.children) || continue
a = viewport(scene)[]
glScissor(ppu(minimum(a))..., ppu(widths(a))...)
# update uniforms
data2[:blur_range] = scene.ssao.blur
GLAbstraction.render(pass2)
end
glDisable(GL_SCISSOR_TEST)
end
glDisable(GL_SCISSOR_TEST)
end

require_context(shader_cache.context)
Expand Down Expand Up @@ -249,21 +251,23 @@ function fxaa_postprocessor(framebuffer, shader_cache)
pass2.postrenderfunction = () -> draw_fullscreen(pass2.vertexarray.id)

color_id = framebuffer[:color][1]
full_render = screen -> begin
fb = screen.framebuffer
w, h = size(fb)

# FXAA - calculate LUMA
glDrawBuffer(luma_id)
glViewport(0, 0, w, h)
# necessary with negative SSAO bias...
glClearColor(1, 1, 1, 1)
glClear(GL_COLOR_BUFFER_BIT)
GLAbstraction.render(pass1)
full_render = let luma_id = luma_id
screen -> begin
fb = screen.framebuffer
w, h = size(fb)

# FXAA - calculate LUMA
glDrawBuffer(luma_id)
glViewport(0, 0, w, h)
# necessary with negative SSAO bias...
glClearColor(1, 1, 1, 1)
glClear(GL_COLOR_BUFFER_BIT)
GLAbstraction.render(pass1)

# FXAA - perform anti-aliasing
glDrawBuffer(color_id) # color buffer
GLAbstraction.render(pass2)
# FXAA - perform anti-aliasing
glDrawBuffer(color_id) # color buffer
GLAbstraction.render(pass2)
end
end

require_context(shader_cache.context)
Expand Down
12 changes: 6 additions & 6 deletions GLMakie/src/screen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,8 @@
key, max_id = p
end
end

i = findfirst(id_scene -> id_scene[1] == max_id, screen.screens)::Int
current_max_id = max_id
i = findfirst(id_scene -> id_scene[1] == current_max_id, screen.screens)::Int
screen.screens[i] = (deleted_id, screen.screens[i][2])

screen.screen2scene[key] = deleted_id
Expand Down Expand Up @@ -970,7 +970,7 @@
try
wait(screen) # isnothing(rendertask) handled in wait(screen)
catch e
@warn "Error while waiting for render task to finish. Cleanup will continue" excetion = (e, Base.catch_backtrace())

Check failure on line 973 in GLMakie/src/screen.jl

View workflow job for this annotation

GitHub Actions / check

excetion ==> exception
end
end
# after done, we can set the task to nothing
Expand Down Expand Up @@ -1085,19 +1085,19 @@
end

function on_demand_renderloop(screen::Screen)
tick_state = Makie.UnknownTickState
tick_state = Ref(Makie.UnknownTickState)
# last_time = time_ns()
reset!(screen.timer, 1.0 / screen.config.framerate)
while isopen(screen) && !screen.stop_renderloop[]
with_context(screen.glscreen) do
pollevents(screen, tick_state) # GLFW poll
pollevents(screen, tick_state[]) # GLFW poll
poll_updates(screen)
if !screen.config.pause_renderloop && requires_update(screen)
tick_state = Makie.RegularRenderTick
tick_state[] = Makie.RegularRenderTick
render_frame(screen)
GLFW.SwapBuffers(to_native(screen))
else
tick_state = ifelse(screen.config.pause_renderloop, Makie.PausedRenderTick, Makie.SkippedRenderTick)
tick_state[] = ifelse(screen.config.pause_renderloop, Makie.PausedRenderTick, Makie.SkippedRenderTick)
end
GC.safepoint()
sleep(screen.timer)
Expand Down
4 changes: 2 additions & 2 deletions Makie/src/basic_recipes/annotation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -934,8 +934,8 @@ function line_rectangle_intersection(p1::Point2, p2::Point2, rect::Rect2)

# Helper function to find intersection of two line segments
function segment_intersection(p1::Point2, p2::Point2, q1::Point2, q2::Point2)
x1, y1 = p1
x2, y2 = p2
local x1, y1 = p1
local x2, y2 = p2
x3, y3 = q1
x4, y4 = q2

Expand Down
4 changes: 2 additions & 2 deletions Makie/src/basic_recipes/axis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ function draw_axis3d(textbuffer, linebuffer, scale, limits, ranges_labels, fonts
axisnames, axisnames_color, axisnames_size, axisrotation, axisalign,
axisnames_font, titlegap,
gridcolors, gridthickness, axislinewidth, axiscolors,
ttextcolor, trotation, tfontsize, talign, tfont, tgap,
ttextcolor, trotation, tfontsize_raw, talign, tfont, tgap,
padding,
) = args3d # splat to names

Expand All @@ -249,7 +249,7 @@ function draw_axis3d(textbuffer, linebuffer, scale, limits, ranges_labels, fonts
origin = Point{N, Float32}(min.(mini, first.(ranges)))
limit_widths = max.(last.(ranges), maxi) .- origin
% = minimum(limit_widths) / 100 # percentage
tfontsize = (%) .* tfontsize
tfontsize = (%) .* tfontsize_raw
axisnames_size = (%) .* axisnames_size

# index of the direction in which ticks and labels are drawn
Expand Down
8 changes: 4 additions & 4 deletions Makie/src/basic_recipes/band.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ function band_connect(n)
return [GLTriangleFace.(ns, ns .+ 1, ns2); GLTriangleFace.(ns .+ 1, ns2 .+ 1, ns2)]
end

_nanpoint(::Type{<:Point3}) = Point3(NaN)
_nanpoint(::Type{<:Point2}) = Point2(NaN)
function Makie.plot!(plot::Band)
nanpoint(::Type{<:Point3}) = Point3(NaN)
nanpoint(::Type{<:Point2}) = Point2(NaN)
map!(plot, [:lowerpoints, :upperpoints, :direction], :coordinates) do lowerpoints, upperpoints, direction
n = length(lowerpoints)
@assert n == length(upperpoints) "length of lower band is not equal to length of upper band!"
Expand All @@ -47,8 +47,8 @@ function Makie.plot!(plot::Band)
# if either x, upper or lower is NaN, all of them should be NaN to cut out a whole band segment and not just a triangle
for i in 1:n
if isnan(lowerpoints[i]) || isnan(upperpoints[i])
concat[i] = nanpoint(eltype(concat))
concat[n + i] = nanpoint(eltype(concat))
concat[i] = _nanpoint(eltype(concat))
concat[n + i] = _nanpoint(eltype(concat))
end
end
return concat
Expand Down
16 changes: 9 additions & 7 deletions Makie/src/basic_recipes/barplot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -264,22 +264,24 @@ function barplot_labels(
color_over_background, color_over_bar, label_formatter, label_offset, label_rotation,
label_align, label_position, fillto
)
if bar_labels isa Symbol && bar_labels in (:x, :y)
bar_labels = map(xpositions, ypositions) do x, y
computed_labels = if bar_labels isa Symbol && bar_labels in (:x, :y)
map(xpositions, ypositions) do x, y
if bar_labels === :x
x
else
y
end
end
else
bar_labels
end
return if bar_labels isa AbstractVector
if length(bar_labels) == length(xpositions)
return if computed_labels isa AbstractVector
if length(computed_labels) == length(xpositions)
attributes = text_attributes(
ypositions, in_y_direction, flip_labels_at, color_over_background,
color_over_bar, label_offset, label_rotation, label_align, label_position
)
label_pos = broadcast(xpositions, ypositions, offset, bar_labels, label_position, fillto) do x, y, off, l, lpos, fto
label_pos = broadcast(xpositions, ypositions, offset, computed_labels, label_position, fillto) do x, y, off, l, lpos, fto
str = string(label_formatter(l))
p = if in_y_direction
if lpos == :end
Expand All @@ -298,10 +300,10 @@ function barplot_labels(
end
return (label_pos, attributes...)
else
error("Labels and bars need to have same length. Found: $(length(xpositions)) bars with these labels: $(bar_labels)")
error("Labels and bars need to have same length. Found: $(length(xpositions)) bars with these labels: $(computed_labels)")
end
else
error("Unsupported label type: $(typeof(bar_labels)). Use: :x, :y, or a vector of values that can be converted to strings.")
error("Unsupported label type: $(typeof(computed_labels)). Use: :x, :y, or a vector of values that can be converted to strings.")
end
end

Expand Down
25 changes: 13 additions & 12 deletions Makie/src/basic_recipes/contourf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -212,22 +212,23 @@ function register_contourf_computations!(graph, argname)
return
end

function _calculate_polys!(polys, colors, xs, ys, zs, levels, is_extended_low, is_extended_high)
levels = copy(levels)
@assert issorted(levels)
is_extended_low && pushfirst!(levels, -Inf)
is_extended_high && push!(levels, Inf)
lows = levels[1:(end - 1)]
highs = levels[2:end]

calculate_contourf_polys!(polys, colors, xs, ys, zs, lows, highs)
return
end

function Makie.plot!(c::Contourf{<:Union{<:Tuple{<:AbstractVector{<:Real}, <:AbstractVector{<:Real}, <:AbstractMatrix{<:Real}}, <:Tuple{<:AbstractMatrix{<:Real}, <:AbstractMatrix{<:Real}, <:AbstractMatrix{<:Real}}}})
graph = c.attributes

register_contourf_computations!(graph, :z)

function calculate_polys!(polys, colors, xs, ys, zs, levels, is_extended_low, is_extended_high)
levels = copy(levels)
@assert issorted(levels)
is_extended_low && pushfirst!(levels, -Inf)
is_extended_high && push!(levels, Inf)
lows = levels[1:(end - 1)]
highs = levels[2:end]

calculate_contourf_polys!(polys, colors, xs, ys, zs, lows, highs)
return
end

register_computation!(
graph,
Expand All @@ -242,7 +243,7 @@ function Makie.plot!(c::Contourf{<:Union{<:Tuple{<:AbstractVector{<:Real}, <:Abs
else
polys, colors = empty!.(values(cached))
end
calculate_polys!(polys, colors, xs, ys, zs, levels, is_extended_low, is_extended_high)
_calculate_polys!(polys, colors, xs, ys, zs, levels, is_extended_low, is_extended_high)
return (polys, colors)
end

Expand Down
6 changes: 3 additions & 3 deletions Makie/src/basic_recipes/contours.jl
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,12 @@ function plot!(plot::Contour{<:Tuple{X, Y, Z, Vol}}) where {X, Y, Z, Vol}
# isosurfaces
# GLMakie texture size is typically limited 8192+
# WGLMakie texture size may be limited to 4096+
N = ceil(Int, 2.5 * (max - min) / isorange)
if N > 4096
N_raw = ceil(Int, 2.5 * (max - min) / isorange)
if N_raw > 4096
min_isorange = (max - min) / 4096
@warn "Isorange maybe too small to resolve iso surfaces. Try `isorange > $min_isorange`"
end
N = clamp(N, 100, 4096)
N = clamp(N_raw, 100, 4096)

clip_range = tight_colorrange[1] - isorange .. tight_colorrange[2] + isorange
return map(1:N) do i
Expand Down
8 changes: 4 additions & 4 deletions Makie/src/basic_recipes/datashader.jl
Original file line number Diff line number Diff line change
Expand Up @@ -175,15 +175,15 @@ module Aggregation
out[i, j] = update(op, out[i, j], z)
end
end

mini, maxi = Inf, -Inf
map!(pixelbuffer, aggbuffer) do x
final_value = value(op, x)

for i in eachindex(pixelbuffer, aggbuffer)
final_value = value(op, aggbuffer[i])
if isfinite(final_value)
mini = min(final_value, mini)
maxi = max(final_value, maxi)
end
return final_value
pixelbuffer[i] = final_value
end
c.data_extrema = (mini, maxi)
return c
Expand Down
12 changes: 8 additions & 4 deletions Makie/src/basic_recipes/poly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,18 @@ function plot!(plot::Poly{<:Tuple{<:Union{Polygon, MultiPolygon, Rect2, Circle,

map!(to_lines, plot, :polygon, [:outline, :increment_at])
map!(plot, [:outline, :increment_at, :strokecolor, :meshes], :computed_strokecolor) do outline, increment_at, sc, meshes
if !(meshes isa Mesh) && meshes isa AbstractVector && sc isa AbstractVector && length(sc) == length(meshes)
if meshes isa AbstractVector && sc isa AbstractVector && length(sc) == length(meshes)
new_colors = similar(sc, length(outline))
mesh_idx = 1
return map(eachindex(outline)) do point_idx
if point_idx == increment_at[mesh_idx]
next_switch = isempty(increment_at) ? -1 : increment_at[1]
for point_idx in eachindex(outline)
if point_idx == next_switch
mesh_idx += 1
next_switch = increment_at[mesh_idx]
end
return sc[mesh_idx]
new_colors[point_idx] = sc[mesh_idx]
end
return new_colors
else
return sc
end
Expand Down
Loading
Loading