# HG changeset patch # User Rik # Date 1398354040 25200 # Node ID 8b566ad1f88afeefdebf80232c01e4593bff9450 # Parent 777281eeb3d459160ed96df4a2ff3b9362e6a37e# Parent 01aa90ece9a4f15d861c53307bbb2c9e8161400e maint: Periodic merge of stable to gui-release. diff -r 777281eeb3d4 -r 8b566ad1f88a libgui/qterminal/libqterminal/unix/TerminalView.cpp --- a/libgui/qterminal/libqterminal/unix/TerminalView.cpp Wed Apr 23 08:42:19 2014 +0200 +++ b/libgui/qterminal/libqterminal/unix/TerminalView.cpp Thu Apr 24 08:40:40 2014 -0700 @@ -212,6 +212,9 @@ // Disabling kerning saves some computation when rendering text. // font.setKerning(false); + font.setStyleStrategy ( QFont::StyleStrategy(font.styleStrategy() + | QFont::ForceIntegerMetrics) ); + QWidget::setFont(font); fontChange(font); } diff -r 777281eeb3d4 -r 8b566ad1f88a libinterp/corefcn/dot.cc --- a/libinterp/corefcn/dot.cc Wed Apr 23 08:42:19 2014 +0200 +++ b/libinterp/corefcn/dot.cc Thu Apr 24 08:40:40 2014 -0700 @@ -142,7 +142,7 @@ argx = argx.reshape (dimx); dimy = dimy.redim (1); argy = argy.reshape (dimy); - match = ! error_state; + match = ! error_state && (dimx == dimy); } if (match) @@ -262,6 +262,16 @@ %! assert (dot (x, y, 2), [17; 53]); %! assert (dot (x, y, 3), [5 12; 21 32]); +%% Test input validation +%!error dot () +%!error dot (1) +%!error dot (1,2,3,4) +%!error dot ({1,2}, [3,4]) +%!error dot ([1,2], {3,4}) +%!error dot ([1 2], [1 2 3]) +%!error dot ([1 2]', [1 2 3]') +%!error dot (ones (2,2), ones (2,3)) +%!error dot ([1 2], [1 2], 0) */ DEFUN (blkmm, args, , diff -r 777281eeb3d4 -r 8b566ad1f88a libinterp/corefcn/gl2ps-renderer.cc --- a/libinterp/corefcn/gl2ps-renderer.cc Wed Apr 23 08:42:19 2014 +0200 +++ b/libinterp/corefcn/gl2ps-renderer.cc Thu Apr 24 08:40:40 2014 -0700 @@ -190,13 +190,14 @@ template static void -draw_pixels (GLsizei w, GLsizei h, GLenum format, const T *data) +draw_pixels (GLsizei w, GLsizei h, GLenum format, const T *data, float maxval) { OCTAVE_LOCAL_BUFFER (GLfloat, a, 3*w*h); - for (int i = 0; i < 3*w*h; i++) - a[i] = data[i]; - + // Convert to GL_FLOAT as it is the only type gl2ps accepts. + for (unsigned int i = 0; i < 3*w*h; i++) + a[i] = data[i] / maxval; + gl2psDrawPixels (w, h, 0, 0, format, GL_FLOAT, a); } @@ -204,10 +205,12 @@ glps_renderer::draw_pixels (GLsizei w, GLsizei h, GLenum format, GLenum type, const GLvoid *data) { - if (type == GL_UNSIGNED_SHORT) - ::draw_pixels (w, h, format, static_cast (data)); - else if (type == GL_UNSIGNED_BYTE) - ::draw_pixels (w, h, format, static_cast (data)); + // gl2psDrawPixels only supports the GL_FLOAT type. + // Other formats, such as uint8, must be converted first. + if (type == GL_UNSIGNED_BYTE) + ::draw_pixels (w, h, format, static_cast (data), 255.0f); + else if (type == GL_UNSIGNED_SHORT) + ::draw_pixels (w, h, format, static_cast (data), 65535.0f); else gl2psDrawPixels (w, h, 0, 0, format, type, data); } diff -r 777281eeb3d4 -r 8b566ad1f88a scripts/plot/appearance/axis.m --- a/scripts/plot/appearance/axis.m Wed Apr 23 08:42:19 2014 +0200 +++ b/scripts/plot/appearance/axis.m Thu Apr 24 08:40:40 2014 -0700 @@ -341,7 +341,7 @@ ## Extend image data one pixel idx = strcmp (types, "image"); - if (! isempty (idx) && (ax == "x" || ax == "y")) + if (any (idx) && (ax == "x" || ax == "y")) imdata = data(idx); px = arrayfun (@__image_pixel_size__, kids(idx), "uniformoutput", false); ipx = ifelse (ax == "x", 1, 2);