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

Commit

Permalink
Merge pull request #157 from greimel/linestyle
Browse files Browse the repository at this point in the history
attempt at scaling linestyle patterns by linewidth
  • Loading branch information
SimonDanisch authored Apr 12, 2021
2 parents 099bb6f + fa6e860 commit 60f6a12
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/drawing_primitives.jl
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,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 @@ -229,7 +235,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

0 comments on commit 60f6a12

Please # to comment.