Skip to content

Commit

Permalink
Skip resolution caching (#3649)
Browse files Browse the repository at this point in the history
* skip resolution caching

* document change

* add test

---------

Co-authored-by: Simon <[email protected]>
  • Loading branch information
ffreyer and SimonDanisch authored Feb 22, 2024
1 parent 91a0a6c commit 1e7a47d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- Added `PointBased` conversion trait to `scatterlines` recipe [#3603](https://github.com/MakieOrg/Makie.jl/pull/3603).
- Multiple small fixes for `map_latest`, `WGLMakie` picking and `PlotSpec` [#3637](https://github.com/MakieOrg/Makie.jl/pull/3637).
- Fixed PolarAxis `rticks` being incompatible with rich text. [#3615](https://github.com/MakieOrg/Makie.jl/pull/3615)
- Fixed an issue causing lines, scatter and text to not scale with resolution after deleting plots in GLMakie. [#3649](https://github.com/MakieOrg/Makie.jl/pull/3649)

## [0.20.7] - 2024-02-04

Expand Down
4 changes: 2 additions & 2 deletions GLMakie/src/drawing_primitives.jl
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ function connect_camera!(plot, gl_attributes, cam, space = gl_attributes[:space]
end
# resolution in real hardware pixels, not scaled pixels/units
get!(gl_attributes, :resolution) do
get!(cam.calculated_values, :resolution) do
# get!(cam.calculated_values, :resolution) do
return lift(*, plot, gl_attributes[:px_per_unit], cam.resolution)
end
# end
end

delete!(gl_attributes, :space)
Expand Down
20 changes: 20 additions & 0 deletions GLMakie/test/unit_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -443,3 +443,23 @@ end
im[3][] = zeros(RGBf, 25, 15) # larger size
GLMakie.closeall()
end

@testset "Verify camera uniforms after delete" begin
f=Figure(size=(200,200))
screen = display(f, visible = false)
ax=Axis(f[1,1])
lines!(ax,sin.(0.0:0.1:2pi))
text!(ax,10.0,0.0,text="sine wave")
empty!(ax)
ids = [robj.id for (_, _, robj) in screen.renderlist]

lines!(ax, sin.(0.0:0.1:2pi))
text!(ax,10.0,0.0,text="sine wave")
resize!(current_figure(), 800, 800)

robj = filter(x -> !(x.id in ids), last.(screen.renderlist))[1]
cam = ax.scene.camera

@test robj.uniforms[:resolution][] == screen.px_per_unit[] * cam.resolution[]
@test robj.uniforms[:projectionview][] == cam.projectionview[]
end

14 comments on commit 1e7a47d

@SimonDanisch
Copy link
Member

Choose a reason for hiding this comment

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

@JuliaRegistrator register()

@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/101494

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

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.20.8 -m "<description of version>" 1e7a47dcfe93d6955982f29e7da659b077df39e4
git push origin v0.20.8

@SimonDanisch
Copy link
Member

Choose a reason for hiding this comment

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

JuliaRegistrator register subdir=GLMakie

@SimonDanisch
Copy link
Member

Choose a reason for hiding this comment

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

JuliaRegistrator register subdir=WGLMakie

@SimonDanisch
Copy link
Member

Choose a reason for hiding this comment

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

JuliaRegistrator register subdir=CairoMakie

@SimonDanisch
Copy link
Member

Choose a reason for hiding this comment

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

JuliaRegistrator register subdir=RPRMakie

@SimonDanisch
Copy link
Member

Choose a reason for hiding this comment

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

@JuliaRegistrator register subdir=GLMakie
@JuliaRegistrator register subdir=WGLMakie
@JuliaRegistrator register subdir=CairoMakie
@JuliaRegistrator register subdir=RPRMakie

@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/101496

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

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 GLMakie-v0.9.9 -m "<description of version>" 1e7a47dcfe93d6955982f29e7da659b077df39e4
git push origin GLMakie-v0.9.9

@SimonDanisch
Copy link
Member

Choose a reason for hiding this comment

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

@JuliaRegistrator register subdir=WGLMakie

@SimonDanisch
Copy link
Member

Choose a reason for hiding this comment

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

@JuliaRegistrator register subdir=CairoMakie

@SimonDanisch
Copy link
Member

Choose a reason for hiding this comment

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

@JuliaRegistrator register subdir=RPRMakie

@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/101499

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

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 WGLMakie-v0.9.8 -m "<description of version>" 1e7a47dcfe93d6955982f29e7da659b077df39e4
git push origin WGLMakie-v0.9.8

@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/101500

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

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 CairoMakie-v0.11.9 -m "<description of version>" 1e7a47dcfe93d6955982f29e7da659b077df39e4
git push origin CairoMakie-v0.11.9

@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/101501

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

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 RPRMakie-v0.6.8 -m "<description of version>" 1e7a47dcfe93d6955982f29e7da659b077df39e4
git push origin RPRMakie-v0.6.8

Please sign in to comment.