gr: update padding constraints before first plot

This commit is contained in:
Josef Heinen 2017-08-26 06:49:00 -04:00
parent 78b0918216
commit a5751895f0

View File

@ -579,7 +579,7 @@ function gr_get_ticks_size(ticks, i)
return l
end
function gr_update_min_padding(sp::Subplot{GRBackend})
function _update_min_padding!(sp::Subplot{GRBackend})
# Add margin given by the user
leftpad = 2mm + sp[:left_margin]
toppad = 2mm + sp[:top_margin]
@ -620,9 +620,8 @@ function gr_update_min_padding(sp::Subplot{GRBackend})
sp.minpad = (leftpad, toppad, rightpad, bottompad)
end
function gr_display(sp::Subplot{GRBackend}, w, h, viewport_canvas)
gr_update_min_padding(sp)
_update_min_padding!(sp)
# the viewports for this subplot
viewport_subplot = gr_viewport_from_bbox(sp, bbox(sp), w, h, viewport_canvas)