Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

attempt at scaling linestyle patterns by linewidth #157

Merged
merged 1 commit into from
Apr 12, 2021
Merged
Changes from all commits
Commits
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
16 changes: 14 additions & 2 deletions src/drawing_primitives.jl
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,13 @@ function draw_atomic(screen::GLScreen, scene::Scene, @nospecialize(x::Lines))
robj = cached_robj!(screen, scene, x) do gl_attributes
linestyle = pop!(gl_attributes, :linestyle)
data = Dict{Symbol, Any}(gl_attributes)
data[:pattern] = to_value(linestyle)
ls = to_value(linestyle)
if isnothing(ls)
data[:pattern] = ls
else
linewidth = gl_attributes[:thickness]
data[:pattern] = ls .* (to_value(linewidth) * 0.25)
end
positions = handle_view(x[1], data)
positions = apply_transform(transform_func_obs(x), positions)
handle_intensities!(data)
Expand All @@ -227,7 +233,13 @@ function draw_atomic(screen::GLScreen, scene::Scene, @nospecialize(x::LineSegmen
robj = cached_robj!(screen, scene, x) do gl_attributes
linestyle = pop!(gl_attributes, :linestyle)
data = Dict{Symbol, Any}(gl_attributes)
data[:pattern] = to_value(linestyle)
ls = to_value(linestyle)
if isnothing(ls)
data[:pattern] = ls
else
linewidth = gl_attributes[:thickness]
data[:pattern] = ls .* (to_value(linewidth) * 0.25)
end
positions = handle_view(x.converted[1], data)
positions = apply_transform(transform_func_obs(x), positions)
if haskey(data, :color) && data[:color][] isa AbstractVector{<: Number}
Expand Down