Skip to content

Commit

Permalink
Merge branch 'master' into ff/clipping
Browse files Browse the repository at this point in the history
  • Loading branch information
ffreyer committed Jun 17, 2024
2 parents 6a777f8 + 12aa2fd commit bba5331
Show file tree
Hide file tree
Showing 16 changed files with 270 additions and 484 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Changelog

## [Unreleased]

## [0.21.3] - 2024-06-17

- Fix stack overflows when using `markerspace = :data` with `scatter` [#3960](https://github.com/MakieOrg/Makie.jl/issues/3960).
- CairoMakie: Fix broken SVGs when using non-interpolated image primitives, for example Colorbars, with recent Cairo versions [#3967](https://github.com/MakieOrg/Makie.jl/pull/3967).
- CairoMakie: Add argument `pdf_version` to restrict the PDF version when saving a figure as a PDF [#3845](https://github.com/MakieOrg/Makie.jl/pull/3845).
- CairoMakie: Fix incorrect scaling factor for SVGs with Cairo_jll 1.18 [#3964](https://github.com/MakieOrg/Makie.jl/pull/3964).

## [0.21.2] - 2024-05-22

Expand Down Expand Up @@ -506,8 +512,9 @@ All other changes are collected [in this PR](https://github.com/MakieOrg/Makie.j
- Fixed rendering of `heatmap`s with one or more reversed ranges in CairoMakie, as in `heatmap(1:10, 10:-1:1, rand(10, 10))` [#1100](https://github.com/MakieOrg/Makie.jl/pull/1100).
- Fixed volume slice recipe and added docs for it [#1123](https://github.com/MakieOrg/Makie.jl/pull/1123).

[Unreleased]: https://github.com/MakieOrg/Makie.jl/compare/v0.21.2...HEAD
[0.21.2]: https://github.com/MakieOrg/Makie.jl/compare/v0.21.0...v0.21.2
[Unreleased]: https://github.com/MakieOrg/Makie.jl/compare/v0.21.3...HEAD
[0.21.3]: https://github.com/MakieOrg/Makie.jl/compare/v0.21.2...v0.21.3
[0.21.2]: https://github.com/MakieOrg/Makie.jl/compare/v0.21.1...v0.21.2
[0.21.1]: https://github.com/MakieOrg/Makie.jl/compare/v0.21.0...v0.21.1
[0.21.0]: https://github.com/MakieOrg/Makie.jl/compare/v0.20.10...v0.21.0
[0.20.10]: https://github.com/MakieOrg/Makie.jl/compare/v0.20.9...v0.20.10
Expand Down
6 changes: 4 additions & 2 deletions CairoMakie/Project.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name = "CairoMakie"
uuid = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
author = ["Simon Danisch <sdanisch@gmail.com>"]
version = "0.12.2"
version = "0.12.3"

[deps]
CRC32c = "8bf52ea8-c179-5cab-976a-9e18b702a9bc"
Cairo = "159f3aea-2a34-519c-b102-8c37f9878175"
Cairo_jll = "83423d85-b0ee-5818-9007-b63ccbeb887a"
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
FreeType = "b38be410-82b0-50bf-ab77-7b57e271db43"
Expand All @@ -17,12 +18,13 @@ PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
[compat]
CRC32c = "1.0, 1.6"
Cairo = "1.0.4"
Cairo_jll = "1.18.0"
Colors = "0.10, 0.11, 0.12"
FileIO = "1.1"
FreeType = "3, 4.0"
GeometryBasics = "0.4.11"
LinearAlgebra = "1.0, 1.6"
Makie = "=0.21.2"
Makie = "=0.21.3"
PrecompileTools = "1.0"
julia = "1.3"

Expand Down
9 changes: 6 additions & 3 deletions CairoMakie/src/infrastructure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ end
# instead of the whole Scene
# - Recognize when a screen is an image surface, and set scale to render the plot
# at the scale of the device pixel
function draw_plot_as_image(scene::Scene, screen::Screen, primitive::Plot, scale::Number = 1)
function draw_plot_as_image(scene::Scene, screen::Screen{RT}, primitive::Plot, scale::Number = 1) where RT
# you can provide `p.rasterize = scale::Int` or `p.rasterize = true`, both of which are numbers

# Extract scene width in device indepentent units
Expand All @@ -163,8 +163,11 @@ function draw_plot_as_image(scene::Scene, screen::Screen, primitive::Plot, scale
# Cairo.scale(screen.context, w / scr.surface.width, h / scr.surface.height)
Cairo.set_source_surface(screen.context, scr.surface, 0, 0)
p = Cairo.get_source(scr.context)
# this is needed to avoid blurry edges
Cairo.pattern_set_extend(p, Cairo.EXTEND_PAD)
if RT !== SVG
# this is needed to avoid blurry edges in png renderings, however since Cairo 1.18 this
# setting seems to create broken SVGs
Cairo.pattern_set_extend(p, Cairo.EXTEND_PAD)
end
# Set filter doesn't work!?
Cairo.pattern_set_filter(p, Cairo.FILTER_BILINEAR)
Cairo.fill(screen.context)
Expand Down
9 changes: 6 additions & 3 deletions CairoMakie/src/primitives.jl
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ premultiplied_rgba(a::AbstractArray{<:Color}) = RGBA.(a)
premultiplied_rgba(r::RGBA) = RGBA(r.r * r.alpha, r.g * r.alpha, r.b * r.alpha, r.alpha)
premultiplied_rgba(c::Colorant) = premultiplied_rgba(RGBA(c))

function draw_atomic(scene::Scene, screen::Screen, @nospecialize(primitive::Union{Heatmap, Image}))
function draw_atomic(scene::Scene, screen::Screen{RT}, @nospecialize(primitive::Union{Heatmap, Image})) where RT
ctx = screen.context
image = primitive[3][]
xs, ys = primitive[1][], primitive[2][]
Expand Down Expand Up @@ -794,8 +794,11 @@ function draw_atomic(scene::Scene, screen::Screen, @nospecialize(primitive::Unio
Cairo.scale(ctx, w / s.width, h / s.height)
Cairo.set_source_surface(ctx, s, 0, 0)
p = Cairo.get_source(ctx)
# this is needed to avoid blurry edges
Cairo.pattern_set_extend(p, Cairo.EXTEND_PAD)
if RT !== SVG
# this is needed to avoid blurry edges in png renderings, however since Cairo 1.18 this
# setting seems to create broken SVGs
Cairo.pattern_set_extend(p, Cairo.EXTEND_PAD)
end
filt = interpolate ? Cairo.FILTER_BILINEAR : Cairo.FILTER_NEAREST
Cairo.pattern_set_filter(p, filt)
Cairo.fill(ctx)
Expand Down
10 changes: 7 additions & 3 deletions CairoMakie/src/screen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,17 @@ struct ScreenConfig
end
end

css_px_per_unit(pt_per_unit) = pt_per_unit / 0.75

function device_scaling_factor(rendertype, sc::ScreenConfig)
isv = is_vector_backend(convert(RenderType, rendertype))
return isv ? sc.pt_per_unit : sc.px_per_unit
rt = convert(RenderType, rendertype)
isv = is_vector_backend(rt)
# from version 1.18 on, Cairo saves SVGs without the pt unit specified, so they are actually in CSS px now
return rt === SVG ? css_px_per_unit(sc.pt_per_unit) : isv ? sc.pt_per_unit : sc.px_per_unit
end

function device_scaling_factor(surface::Cairo.CairoSurface, sc::ScreenConfig)
return is_vector_backend(surface) ? sc.pt_per_unit : sc.px_per_unit
return device_scaling_factor(get_render_type(surface), sc)
end

const LAST_INLINE = Ref{Union{Makie.Automatic,Bool}}(Makie.automatic)
Expand Down
4 changes: 2 additions & 2 deletions GLMakie/Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "GLMakie"
uuid = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
version = "0.10.2"
version = "0.10.3"

[deps]
ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
Expand Down Expand Up @@ -30,7 +30,7 @@ FreeTypeAbstraction = "0.10"
GLFW = "3.3"
GeometryBasics = "0.4.11"
LinearAlgebra = "1.0, 1.6"
Makie = "=0.21.2"
Makie = "=0.21.3"
Markdown = "1.0, 1.6"
MeshIO = "0.4"
ModernGL = "1"
Expand Down
2 changes: 1 addition & 1 deletion MakieCore/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MakieCore"
uuid = "20f20a25-4f0e-4fdf-b5d1-57303727442b"
authors = ["Simon Danisch"]
version = "0.8.2"
version = "0.8.3"

[deps]
ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Makie"
uuid = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
authors = ["Simon Danisch", "Julius Krumbiegel"]
version = "0.21.2"
version = "0.21.3"

[deps]
Animations = "27a7e980-b3e6-11e9-2bcd-0b925532e340"
Expand Down Expand Up @@ -90,7 +90,7 @@ KernelDensity = "0.5, 0.6"
LaTeXStrings = "1.2"
LinearAlgebra = "1.0, 1.6"
MacroTools = "0.5"
MakieCore = "=0.8.2"
MakieCore = "=0.8.3"
Markdown = "1.0, 1.6"
MathTeXEngine = "0.5, 0.6"
Observables = "0.5.5"
Expand Down
4 changes: 2 additions & 2 deletions RPRMakie/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "RPRMakie"
uuid = "22d9f318-5e34-4b44-b769-6e3734a732a6"
authors = ["Simon Danisch"]
version = "0.7.2"
version = "0.7.3"

[deps]
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
Expand All @@ -17,7 +17,7 @@ Colors = "0.9, 0.10, 0.11, 0.12"
FileIO = "1.6"
GeometryBasics = "0.4.11"
LinearAlgebra = "1.0, 1.6"
Makie = "=0.21.2"
Makie = "=0.21.3"
Printf = "1.0, 1.6"
RadeonProRender = "0.3.0"
julia = "1.3"
Expand Down
4 changes: 2 additions & 2 deletions WGLMakie/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "WGLMakie"
uuid = "276b4fcb-3e11-5398-bf8b-a0c2d153d008"
authors = ["SimonDanisch <sdanisch@gmail.com>"]
version = "0.10.2"
version = "0.10.3"

[deps]
Bonito = "824d6782-a2ef-11e9-3a09-e5662e0c26f8"
Expand All @@ -27,7 +27,7 @@ FreeTypeAbstraction = "0.10"
GeometryBasics = "0.4.11"
Hyperscript = "0.0.3, 0.0.4, 0.0.5"
LinearAlgebra = "1.0, 1.6"
Makie = "=0.21.2"
Makie = "=0.21.3"
Observables = "0.5.1"
PNGFiles = "0.3, 0.4"
PrecompileTools = "1.0"
Expand Down
3 changes: 2 additions & 1 deletion docs/makedocs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ pages = [
]
],
"Tutorials" => [
"tutorials/basic-tutorial.md",
"tutorials/getting-started.md",
"tutorials/aspect-tutorial.md",
"tutorials/layout-tutorial.md",
"tutorials/scenes.md",
Expand Down Expand Up @@ -230,6 +230,7 @@ generate_redirects([
"/explanations/observables.html" => "/explanations/nodes/index.html",
"/reference/plots/overview.html" => "/reference/plots/index.html",
"/reference/blocks/overview.html" => "/reference/blocks/index.html",
"/tutorials/getting-started.html" => "/tutorials/basic-tutorial.html",
], dry_run = false)

deploy(params; target = "build")
4 changes: 2 additions & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ hero:
actions:
- theme: brand
text: Getting started
link: /tutorials/basic-tutorial
link: /tutorials/getting-started
- theme: alt
text: View on Github
link: https://github.com/MakieOrg/Makie.jl
Expand Down Expand Up @@ -107,7 +107,7 @@ There's no need to install `Makie.jl` separately, it is re-exported by each back

## First Steps

If you are new to Makie, have a look at [Getting started with Makie](@ref).
If you are new to Makie, have a look at [Getting started](@ref).

For inspiration, visit [Beautiful Makie](https://beautiful.makie.org/) for a collection of interesting plots.

Expand Down
Loading

0 comments on commit bba5331

Please sign in to comment.