Skip to content

Commit

Permalink
Merge branch 'master' into cont_bug_nan
Browse files Browse the repository at this point in the history
  • Loading branch information
t-bltg committed Oct 25, 2023
2 parents 5896ec3 + ffa626c commit f3d33d7
Show file tree
Hide file tree
Showing 120 changed files with 14,044 additions and 10,544 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/Docs.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
name: Docs build and deploy
on:
push:
pull_request:
branches:
- main
- master
- breaking-release
tags: '*'
pull_request:
- sd/beta-20
push:
tags:
- '*'
branches:
- main
- master
- breaking-release

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -21,7 +19,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false
# NOTE: Python is necessary for the pre-rendering (minification) step
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/cairomakie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@ on:
- '*.md'
branches:
- master
- breaking-release
- sd/beta-20
push:
paths-ignore:
- 'docs/**'
- '*.md'
branches:
- master
- breaking-release
tags: '*'
tags:
- '*'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -36,7 +31,7 @@ jobs:
- x64
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@ on:
- '*.md'
branches:
- master
- breaking-release
- sd/beta-20
push:
paths-ignore:
- 'docs/**'
- '*.md'
tags:
- '*'
branches:
- master
- breaking-release
tags: '*'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -36,7 +33,7 @@ jobs:
- x64
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/compilation-benchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- '*.md'
branches:
- master
- breaking-release
- sd/beta-20
jobs:
benchmark:
name: ${{ matrix.package }}
Expand All @@ -20,7 +20,7 @@ jobs:
- WGLMakie
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install xvfb
run: sudo apt-get update && sudo apt-get install -y xorg-dev mesa-utils xvfb libgl1 freeglut3-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev
- uses: julia-actions/setup-julia@v1
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/glmakie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@ on:
- '*.md'
branches:
- master
- breaking-release
- sd/beta-20
push:
paths-ignore:
- 'docs/**'
- '*.md'
tags:
- '*'
branches:
- master
- breaking-release
tags: '*'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -38,13 +35,13 @@ jobs:
- x64
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v1
- run: sudo apt-get update && sudo apt-get install -y xorg-dev mesa-utils xvfb libgl1 freeglut3-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev
- run: sudo apt-get update && sudo apt-get install -y xorg-dev mesa-utils xvfb libgl1 freeglut3-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev xsettingsd x11-xserver-utils
- name: Install Julia dependencies
shell: julia --project=monorepo {0}
run: |
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/rprmakie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@ on:
- '*.md'
branches:
- master
- breaking-release
- sd/beta-20
push:
paths-ignore:
- 'docs/**'
- '*.md'
tags:
- '*'
branches:
- master
- breaking-release
tags: '*'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand All @@ -35,7 +32,7 @@ jobs:
- x64
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale_preview_removal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: gh-pages
- uses: julia-actions/setup-julia@v1
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/wglmakie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,12 @@ on:
- '*.md'
branches:
- master
- breaking-release
- sd/beta-20
push:
paths-ignore:
- 'docs/**'
- '*.md'
tags:
- '*'
branches:
- master
- breaking-release
tags: '*'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
Expand All @@ -36,7 +32,7 @@ jobs:
- x64
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
Expand Down
4 changes: 2 additions & 2 deletions CairoMakie/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "CairoMakie"
uuid = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
author = ["Simon Danisch <sdanisch@gmail.com>"]
version = "0.10.8"
version = "0.10.11"

[deps]
Base64 = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Expand All @@ -23,7 +23,7 @@ FFTW = "1"
FileIO = "1.1"
FreeType = "3, 4.0"
GeometryBasics = "0.4.1"
Makie = "=0.19.8"
Makie = "=0.19.11"
PrecompileTools = "1.0"
julia = "1.3"

Expand Down
34 changes: 30 additions & 4 deletions CairoMakie/src/overrides.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,12 @@ function draw_poly(scene::Scene, screen::Screen, poly, points_list::Vector{<:Vec
end

draw_poly(scene::Scene, screen::Screen, poly, rect::Rect2) = draw_poly(scene, screen, poly, [rect])
draw_poly(scene::Scene, screen::Screen, poly, bezierpath::BezierPath) = draw_poly(scene, screen, poly, [bezierpath])

function draw_poly(scene::Scene, screen::Screen, poly, rects::Vector{<:Rect2})
function draw_poly(scene::Scene, screen::Screen, poly, shapes::Vector{<:Union{Rect2,BezierPath}})
model = poly.model[]
space = to_value(get(poly, :space, :data))
projected_rects = project_rect.(Ref(scene), space, rects, Ref(model))
projected_shapes = project_shape.(Ref(scene), space, shapes, Ref(model))

color = to_cairo_color(poly.color[], poly)

Expand All @@ -90,8 +91,8 @@ function draw_poly(scene::Scene, screen::Screen, poly, rects::Vector{<:Rect2})
error("Wrong type for linestyle: $(poly.linestyle[]).")
end
strokecolor = to_cairo_color(poly.strokecolor[], poly)
broadcast_foreach(projected_rects, color, strokecolor, poly.strokewidth[]) do r, c, sc, sw
Cairo.rectangle(screen.context, origin(r)..., widths(r)...)
broadcast_foreach(projected_shapes, color, strokecolor, poly.strokewidth[]) do shape, c, sc, sw
create_shape_path!(screen.context, shape)
set_source(screen.context, c)
Cairo.fill_preserve(screen.context)
isnothing(linestyle_diffed) || Cairo.set_dash(screen.context, linestyle_diffed .* sw)
Expand All @@ -101,6 +102,31 @@ function draw_poly(scene::Scene, screen::Screen, poly, rects::Vector{<:Rect2})
end
end

function project_shape(scene, space, shape::BezierPath, model)
commands = Makie.PathCommand[]
for cmd in shape.commands
if cmd isa EllipticalArc
bezier = Makie.elliptical_arc_to_beziers(cmd)
for b in bezier.commands
push!(commands, project_command(b, scene, space, model))
end
else
push!(commands, project_command(cmd, scene, space, model))
end
end
BezierPath(commands)
end

function create_shape_path!(ctx, r::Rect2)
Cairo.rectangle(ctx, origin(r)..., widths(r)...)
end

function create_shape_path!(ctx, b::BezierPath)
for cmd in b.commands
path_command(ctx, cmd)
end
end

function polypath(ctx, polygon)
isempty(polygon) && return nothing
ext = decompose(Point2f, polygon.exterior)
Expand Down
2 changes: 1 addition & 1 deletion CairoMakie/src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function project_scale(scene::Scene, space, s, model = Mat4f(I))
end
end

function project_rect(scenelike, space, rect::Rect, model)
function project_shape(scenelike, space, rect::Rect, model)
mini = project_position(scenelike, space, minimum(rect), model)
maxi = project_position(scenelike, space, maximum(rect), model)
return Rect(mini, maxi .- mini)
Expand Down
4 changes: 4 additions & 0 deletions CairoMakie/test/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[deps]
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
ReferenceTests = "d37af2e0-5618-4e00-9939-d430db56ee94"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
4 changes: 1 addition & 3 deletions CairoMakie/test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using Test
using CairoMakie
using Pkg
using Makie.FileIO
using ReferenceTests

path = normpath(joinpath(dirname(pathof(Makie)), "..", "ReferenceTests"))
Pkg.develop(PackageSpec(path = path))
# Before changing Pkg environment, try the test in #864
@testset "Runs without error" begin
fig = Figure()
Expand Down
3 changes: 3 additions & 0 deletions CairoMakie/test/svg_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ end
fig
end)
@test svg_isnt_rasterized(poly(Circle(Point2f(0, 0), 10)))
@test svg_isnt_rasterized(poly(BezierPath([
MoveTo(0.0, 0.0), LineTo(1.0, 0.0), LineTo(1.0, 1.0), CurveTo(1.0, 1.0, 0.5, 1.0, 0.5, 0.5), ClosePath()
])))
end

@testset "reproducable svg ids" begin
Expand Down
6 changes: 3 additions & 3 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.8.8"
version = "0.8.11"

[deps]
ColorTypes = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
Expand Down Expand Up @@ -29,11 +29,11 @@ FixedPointNumbers = "0.7, 0.8"
FreeTypeAbstraction = "0.10"
GLFW = "3"
GeometryBasics = "0.4.1"
Makie = "=0.19.8"
Makie = "=0.19.11"
MeshIO = "0.4"
ModernGL = "1"
Observables = "0.5.1"
ShaderAbstractions = "0.3"
ShaderAbstractions = "0.4"
PrecompileTools = "1.0"
StaticArrays = "0.12, 1.0"
julia = "1"
Loading

0 comments on commit f3d33d7

Please sign in to comment.