Skip to content

Commit

Permalink
Fix annotation bug.
Browse files Browse the repository at this point in the history
Would not skip annotation meant for another strip.
  • Loading branch information
ma-laforge committed Jul 4, 2021
1 parent ff70bdd commit eb45590
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "InspectDR"
uuid = "d0351b0e-4b05-5898-87b3-e2a8edfddd1d"
version = "0.4.2"
version = "0.4.3"

[deps]
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Expand Down
17 changes: 8 additions & 9 deletions src/cairo_annotation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ const ALIGN_MAP = Dict{Symbol, CAlignment}(
)


#==Accessors
===============================================================================#
skipannot(a::PlotAnnotation, rstrip::RStrip2D) = (a.strip != rstrip.istrip && a.strip != 0)


#==Rendering text annotation
===============================================================================#
function render(ctx::CairoContext, rstrip::RStrip2D, a::TextAnnotation)
Expand Down Expand Up @@ -77,17 +82,11 @@ end
#==Generic rendering algorithm for annotations
===============================================================================#

#Basic render function for PlotAnnotation types:
function render(ctx::CairoContext, rstrip::RStrip2D, a::PlotAnnotation)
if 0 == a.strip || a.strip == rstrip.istrip
render(ctx, rstrip, a)
end
return
end

function render(ctx::CairoContext, rstrip::RStrip2D, alist::Vector{T}) where T<:PlotAnnotation
for a in alist
render(ctx, rstrip, a)
if !skipannot(a, rstrip)
render(ctx, rstrip, a)
end
end
return
end
Expand Down
5 changes: 5 additions & 0 deletions src/gtk_base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ mutable struct GtkPlot
end


#==Accessors
===============================================================================#
skipannot(::CtrlMarkerGroup, rstrip::RStrip2D) = false


#==Helper functions
===============================================================================#
function refresh_title(gplot::GtkPlot)
Expand Down

2 comments on commit eb45590

@ma-laforge
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@JuliaRegistrator register

Release notes:
Fix annotation bug.

Would not skip annotation meant for another strip.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/40248

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.4.3 -m "<description of version>" eb4559081d3c1adafa765cad5cb5f97cd9c2ddbf
git push origin v0.4.3

Please sign in to comment.