Skip to content

Commit

Permalink
add remaining changes from beta-0.20
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonDanisch committed Aug 16, 2023
1 parent c91d1fd commit 010b27e
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 10 deletions.
4 changes: 2 additions & 2 deletions CairoMakie/src/screen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ end
to_cairo_antialias(aa::Int) = aa

"""
* `px_per_unit = 2.0`: see [figure docs](https://docs.makie.org/stable/documentation/figure/).
* `pt_per_unit = 0.75`: see [figure docs](https://docs.makie.org/stable/documentation/figure/).
* `px_per_unit = 2.0`: see [figure docs](https://docs.makie.org/stable/documentation/figure_size/).
* `pt_per_unit = 0.75`: see [figure docs](https://docs.makie.org/stable/documentation/figure_size/).
* `antialias::Union{Symbol, Int} = :best`: antialias modus Cairo uses to draw. Applicable options: `[:best => Cairo.ANTIALIAS_BEST, :good => Cairo.ANTIALIAS_GOOD, :subpixel => Cairo.ANTIALIAS_SUBPIXEL, :none => Cairo.ANTIALIAS_NONE]`.
* `visible::Bool`: if true, a browser/image viewer will open to display rendered output.
"""
Expand Down
2 changes: 1 addition & 1 deletion GLMakie/src/drawing_primitives.jl
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,10 @@ function draw_atomic(screen::Screen, scene::Scene, @nospecialize(x::LineSegments
if haskey(data, :intensity)
data[:color] = pop!(data, :intensity)
end

# Tweak things for px_per_unit
resolution = pop!(data, :resolution)
data[:resolution] = map((ppu, res) -> ppu .* res, px_per_unit, resolution)

return draw_linesegments(screen, positions, data)
end
end
Expand Down
3 changes: 2 additions & 1 deletion GLMakie/src/screen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,8 @@ function Makie.colorbuffer(screen::Screen, format::Makie.ImageStorageFormat = Ma
# polling may change window size, when its bigger than monitor!
# we still need to poll though, to get all the newest events!
# GLFW.PollEvents()
render_frame(screen, resize_buffers=true) # let it render
# keep current buffer size to allows larger-than-window renders
render_frame(screen, resize_buffers=false) # let it render
if screen.config.visible
GLFW.SwapBuffers(to_native(screen))
else
Expand Down
2 changes: 0 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

## beta

- Fixed an issue where NaN was interpreted as zero when rendering `surface` through CairoMakie. [#2598](https://github.com/MakieOrg/Makie.jl/pull/2598)
- GLMakie has gained support for HiDPI (aka Retina) screens.
This also enables saving images with higher resolution than screen pixel dimensions. [#2544](https://github.com/MakieOrg/Makie.jl/pull/2544)
- Improved 3D camera handling, hotkeys and functionality [#2746](https://github.com/MakieOrg/Makie.jl/pull/2746)
Expand Down Expand Up @@ -42,7 +41,6 @@
- Adjusted scaling of scatter/text stroke, glow and anti-aliasing width under non-uniform 2D scaling (Vec2f markersize/fontsize) in GLMakie [#2950](https://github.com/MakieOrg/Makie.jl/pull/2950).
- Scaled `errorbar` whiskers and `bracket` correctly with transformations [#3012](https://github.com/MakieOrg/Makie.jl/pull/3012).
- Updated `bracket` when the screen is resized or transformations change [#3012](https://github.com/MakieOrg/Makie.jl/pull/3012).
- Added auto-resizing functionality to WGLMakie plot figures [#3042](https://github.com/MakieOrg/Makie.jl/pull/3042)

## v0.19.6

Expand Down
14 changes: 13 additions & 1 deletion ReferenceTests/src/tests/primitives.jl
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ end
f
end

@reference_test "barplot with TeX-ed labels" begin
@reference_test "barplot with TeX-ed labels" begin
fig = Figure(resolution = (800, 800))
lab1 = L"\int f(x) dx"
lab2 = lab1
Expand All @@ -485,3 +485,15 @@ end
wireframe!(a, m, depth_shift = -1f-3, color = :black)
f
end

@reference_test "barplot with TeX-ed labels" begin
fig = Figure(resolution = (800, 800))
lab1 = L"\int f(x) dx"
lab2 = lab1
# lab2 = L"\frac{a}{b} - \sqrt{b}" # this will not work until #2667 is fixed

barplot(fig[1,1], [1, 2], [0.5, 0.2], bar_labels = [lab1, lab2], flip_labels_at = 0.3, direction=:x)
barplot(fig[1,2], [1, 2], [0.5, 0.2], bar_labels = [lab1, lab2], flip_labels_at = 0.3)

fig
end
3 changes: 0 additions & 3 deletions src/display.jl
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,6 @@ const WEB_MIMES = (
MIME"application/prs.juno.plotpane+html",
MIME"juliavscode/html")

# because we have a default way to display pngs in html contexts, we can say that
# if png is showable, so are the html types
Base.showable(mime::Union{WEB_MIMES...}, fig::FigureLike) = showable(MIME"image/png"(), fig)

backend_showable(@nospecialize(screen), @nospecialize(mime)) = false

Expand Down

0 comments on commit 010b27e

Please sign in to comment.