Skip to content
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.

Commit

Permalink
Merge pull request #416 from JuliaPlots/as/fixjuno-1
Browse files Browse the repository at this point in the history
Update the Juno plotpane resizing method
  • Loading branch information
asinghvi17 authored Apr 28, 2020
2 parents 45ab86f + 0085734 commit 3143f1c
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/display.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,23 @@ for M in (MIME"text/plain", MIME)
# set update to true, without triggering an event
# this just indicates, that now we may update on e.g. resize
update!(scene)

# Here, we deal with the Juno plotsize.
# Since SVGs are in units of pt, which is 1/72 in,
# and pixels (which Juno reports its plotsize as)
# are 1/96 in, we need to rescale the scene,
# whose units are in pt, into the expected size in px.
# This means we have to scale by a factor of 72/96.
res = get(io, :juno_plotsize, nothing)
res !== nothing && resize!(scene, res...)
ioc = IOContext(io, :full_fidelity => true, :pt_per_unit => get(io, :pt_per_unit, 0.75), :px_per_unit => get(io, :px_per_unit, 1.0))
if !isnothing(res)
if m isa MIME"image/svg+xml"
res = round.(Int, res .* 0.75)
end
resize!(scene, res...)
end

ioc = IOContext(io, :full_fidelity => true, :pt_per_unit => get(io, :pt_per_unit, 1.0), :px_per_unit => get(io, :px_per_unit, 1.0))

screen = backend_show(current_backend[], ioc, m, scene)

# E.g. text/plain doesn't have a display
Expand Down

2 comments on commit 3143f1c

@asinghvi17
Copy link
Member Author

Choose a reason for hiding this comment

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

@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 updated: JuliaRegistries/General/13769

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.10.6 -m "<description of version>" 3143f1c71fc47c6450c742b01e28028472f19ed3
git push origin v0.10.6

Please sign in to comment.