octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Changeset]: Re: cla() ?


From: Michael Goffioul
Subject: Re: [Changeset]: Re: cla() ?
Date: Tue, 7 Oct 2008 10:16:18 +0200

On Mon, Oct 6, 2008 at 8:02 PM, John W. Eaton <address@hidden> wrote:
> | diff --git a/scripts/plot/__plt_get_axis_arg__.m 
> b/scripts/plot/__plt_get_axis_arg__.m
> | --- a/scripts/plot/__plt_get_axis_arg__.m
> | +++ b/scripts/plot/__plt_get_axis_arg__.m
> | @@ -32,8 +32,8 @@
> |
> |    ## Figure handles are integers, but object handles are non integer,
> |    ## therefore ignore integer scalars.
> | -  if (nargin > 1 && length (varargin) > 0 && ishandle (varargin{1})
> | -      && floor(varargin{1}) != varargin{1})
> | +  if (nargin > 1 && length (varargin) > 0 && numel(varargin{1}) == 1 && 
> ishandle (varargin{1}(1))
> | +      && floor(varargin{1}(1)) != varargin{1}(1))
>
> I think a test like
>
>  floor(varargin{1}(1)) != varargin{1}(1))
>
> depends too much on the current implementation of figure handles.
> Maybe it would be better to use "! isfigure (varargin{1}(1))" instead?

Testing the handle value is definitely NOT the way to go to check
for a figure, given the fact that when IntegerHandle is off, the figure
handle won't be integer anymore. The safest way is simply to check
the Type property of the graphics object (as isfigure does).

Michael.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]