comparison src/gl-render.cc @ 11093:d748acc75658

gl-render.cc: Treat images with scalar unique(x/ydata) like Matlab.
author Ben Abbott <bpabbott@mac.com>
date Sat, 09 Oct 2010 11:42:22 -0400
parents 811d8f113423
children f0e9befd6a1c
comparison
equal deleted inserted replaced
11092:8b9aeb20c03c 11093:d748acc75658
2701 octave_value cdata = props.get_color_data (); 2701 octave_value cdata = props.get_color_data ();
2702 dim_vector dv (cdata.dims ()); 2702 dim_vector dv (cdata.dims ());
2703 int h = dv(0), w = dv(1); 2703 int h = dv(0), w = dv(1);
2704 bool ok = true; 2704 bool ok = true;
2705 2705
2706 const Matrix x = props.get_xdata ().matrix_value (); 2706 Matrix x = props.get_xdata ().matrix_value ();
2707 const Matrix y = props.get_ydata ().matrix_value (); 2707 Matrix y = props.get_ydata ().matrix_value ();
2708
2709 if (w > 1 && x(1) == x(0))
2710 x(1) = x(1) + (w-1);
2711
2712 if (h > 1 && y(1) == y(0))
2713 y(1) = y(1) + (h-1);
2714
2708 const ColumnVector p0 = xform.transform (x(0), y(0), 0); 2715 const ColumnVector p0 = xform.transform (x(0), y(0), 0);
2709 const ColumnVector p1 = xform.transform (x(1), y(1), 0); 2716 const ColumnVector p1 = xform.transform (x(1), y(1), 0);
2710 2717
2711 // image pixel size in screen pixel units 2718 // image pixel size in screen pixel units
2712 float pix_dx, pix_dy; 2719 float pix_dx, pix_dy;