Mercurial > hg > octave-terminal
changeset 13910:2af665333b86
title positioning taking xaxislocation into account (bug #33418)
* graphics.cc (axes::properties::update_title_position):
add x label tick height to title position for xaxislocation
set to "top"
author | Konstantinos Poulios <logari81@googlemail.com> |
---|---|
date | Tue, 22 Nov 2011 18:20:41 +0100 |
parents | c694c4ced5f7 |
children | 1398901839b6 |
files | src/graphics.cc |
diffstat | 1 files changed, 16 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/graphics.cc +++ b/src/graphics.cc @@ -5113,8 +5113,22 @@ // FIXME: bbox should be stored in axes::properties Matrix bbox = get_extent (false); - ColumnVector p = xform.untransform (bbox(0)+bbox(2)/2, (bbox(1)-10), - (x_zlim(0)+x_zlim(1))/2, true); + + ColumnVector p = + graphics_xform::xform_vector (bbox(0)+bbox(2)/2, + bbox(1)-10, + (x_zlim(0)+x_zlim(1))/2); + + if (x2Dtop) + { + Matrix ext (1, 2, 0.0); + ext = get_ticklabel_extents (get_xtick ().matrix_value (), + get_xticklabel ().all_strings (), + get_xlim ().matrix_value ()); + p(1) -= ext(1); + } + + p = xform.untransform (p(0), p(1), p(2), true); title_props.set_position (p.extract_n(0, 3).transpose ()); title_props.set_positionmode ("auto");