Mercurial > hg > octave-lyh
diff src/gl-render.cc @ 15069:7a3957ca99c3
Handle complex arguments in imagesc (bug #36866)
* image.m: Don't error out with complex images, show real part and
warn, like imshow.
* graphics.in.h (array_property): Change type_constraint to std::set
instead of std::list.
(array_property::add_constraint): Use std::set::insert instead of
std::list::push_back.
(image::properties::init): Add new "real" constraint.
* graphics.cc (array_property::validate): Check for new "real" type constraint.
* gl-render.cc (opengl_renderer::draw_image): Abort if no image data is found.
author | Jordi Gutiérrez Hermoso <jordigh@octave.org> |
---|---|
date | Tue, 31 Jul 2012 18:06:54 -0400 |
parents | f7afecdd87ef |
children |
line wrap: on
line diff
--- a/src/gl-render.cc +++ b/src/gl-render.cc @@ -2488,6 +2488,10 @@ Matrix x = props.get_xdata ().matrix_value (); Matrix y = props.get_ydata ().matrix_value (); + // Someone wants us to draw an empty image? No way. + if (x.is_empty () || y.is_empty ()) + return; + if (w > 1 && x(1) == x(0)) x(1) = x(1) + (w-1);