Mercurial > octave-nkf
comparison src/graphics.cc @ 13327:f81fcceb394c
axes: only update the currentaxes property of the parent figure if the axes object is visible
* graphics.cc (F__is_handle_visible__): New function.
is_handle_visible (const graphics_handle&)): New function.
is_handle_visible (double): New function.
is_handle_visible (const octave_valueu&)): New function.
* axes.m: Only set currentaxes property in parent and currentfigure
property in root if axes object is visible.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 12 Oct 2011 11:18:12 -0400 |
parents | 1e12601d2697 |
children | 22ce748da25f |
comparison
equal
deleted
inserted
replaced
13326:23cc9c13b622 | 13327:f81fcceb394c |
---|---|
7664 print_usage (); | 7664 print_usage (); |
7665 | 7665 |
7666 return retval; | 7666 return retval; |
7667 } | 7667 } |
7668 | 7668 |
7669 static bool | |
7670 is_handle_visible (const graphics_handle& h) | |
7671 { | |
7672 return h.ok () && gh_manager::is_handle_visible (h); | |
7673 } | |
7674 | |
7675 static bool | |
7676 is_handle_visible (double val) | |
7677 { | |
7678 return is_handle_visible (gh_manager::lookup (val)); | |
7679 } | |
7680 | |
7681 static octave_value | |
7682 is_handle_visible (const octave_value& val) | |
7683 { | |
7684 octave_value retval = false; | |
7685 | |
7686 if (val.is_real_scalar () && is_handle_visible (val.double_value ())) | |
7687 retval = true; | |
7688 else if (val.is_numeric_type () && val.is_real_type ()) | |
7689 { | |
7690 const NDArray handles = val.array_value (); | |
7691 | |
7692 if (! error_state) | |
7693 { | |
7694 boolNDArray result (handles.dims ()); | |
7695 | |
7696 for (octave_idx_type i = 0; i < handles.numel (); i++) | |
7697 result.xelem (i) = is_handle_visible (handles (i)); | |
7698 | |
7699 retval = result; | |
7700 } | |
7701 } | |
7702 | |
7703 return retval; | |
7704 } | |
7705 | |
7706 DEFUN (__is_handle_visible__, args, , | |
7707 "-*- texinfo -*-\n\ | |
7708 @deftypefn {Built-in Function} __is_handle_visible__ (@var{h})\n\ | |
7709 Undocumented internal function.\n\ | |
7710 @end deftypefn") | |
7711 { | |
7712 octave_value retval; | |
7713 | |
7714 if (args.length () == 1) | |
7715 retval = is_handle_visible (args(0)); | |
7716 else | |
7717 print_usage (); | |
7718 | |
7719 return retval; | |
7720 } | |
7721 | |
7669 DEFUN (reset, args, , | 7722 DEFUN (reset, args, , |
7670 "-*- texinfo -*-\n\ | 7723 "-*- texinfo -*-\n\ |
7671 @deftypefn {Built-in Function} {} reset (@var{h}, @var{property})\n\ | 7724 @deftypefn {Built-in Function} {} reset (@var{h}, @var{property})\n\ |
7672 Remove any defaults set for the handle @var{h}. The default figure\n\ | 7725 Remove any defaults set for the handle @var{h}. The default figure\n\ |
7673 properties of \"position\", \"units\", \"windowstyle\" and\n\ | 7726 properties of \"position\", \"units\", \"windowstyle\" and\n\ |