From 010b27ebbd7b5c75c3cc4a98e1fe16f1f4a3aafb Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 1 Aug 2023 12:58:34 +0200 Subject: [PATCH] add remaining changes from beta-0.20 --- CairoMakie/src/screen.jl | 4 ++-- GLMakie/src/drawing_primitives.jl | 2 +- GLMakie/src/screen.jl | 3 ++- NEWS.md | 2 -- ReferenceTests/src/tests/primitives.jl | 14 +++++++++++++- src/display.jl | 3 --- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/CairoMakie/src/screen.jl b/CairoMakie/src/screen.jl index eb7f95110ed..2de2e552910 100644 --- a/CairoMakie/src/screen.jl +++ b/CairoMakie/src/screen.jl @@ -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. """ diff --git a/GLMakie/src/drawing_primitives.jl b/GLMakie/src/drawing_primitives.jl index 2632aace11f..ec3e37b4f51 100644 --- a/GLMakie/src/drawing_primitives.jl +++ b/GLMakie/src/drawing_primitives.jl @@ -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 diff --git a/GLMakie/src/screen.jl b/GLMakie/src/screen.jl index f08ba935467..96861a6a16c 100644 --- a/GLMakie/src/screen.jl +++ b/GLMakie/src/screen.jl @@ -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 diff --git a/NEWS.md b/NEWS.md index a2d5face35c..8ee35b1d394 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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) @@ -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 diff --git a/ReferenceTests/src/tests/primitives.jl b/ReferenceTests/src/tests/primitives.jl index 0ad0bdb6bfe..f8031475341 100644 --- a/ReferenceTests/src/tests/primitives.jl +++ b/ReferenceTests/src/tests/primitives.jl @@ -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 @@ -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 diff --git a/src/display.jl b/src/display.jl index a64b4cb8dcf..d8f35953bee 100644 --- a/src/display.jl +++ b/src/display.jl @@ -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