Merge pull request #1354 from apalugniok/cropped-image

Fix axis limits not cropping image. Fixes #1296
This commit is contained in:
Daniel Schwabeneder 2018-01-15 14:35:48 +01:00 committed by GitHub
commit decd7c2f60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1200,7 +1200,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
z = transpose_z(series, series[:z].surf, true)'
w, h = size(z)
if eltype(z) <: Colors.AbstractGray
grey = round(UInt8, float(z) * 255)
grey = round.(UInt8, float(z) * 255)
rgba = map(c -> UInt32( 0xff000000 + Int(c)<<16 + Int(c)<<8 + Int(c) ), grey)
else
rgba = map(c -> UInt32( round(Int, alpha(c) * 255) << 24 +
@ -1208,7 +1208,7 @@ function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
round(Int, green(c) * 255) << 8 +
round(Int, red(c) * 255) ), z)
end
GR.drawimage(xmin, xmax, ymax, ymin, w, h, rgba)
GR.drawimage(0, w, h, 0, w, h, rgba)
end
# this is all we need to add the series_annotations text