Mercurial > octave-nkf
comparison src/graphics.h.in @ 11089:d761f0dc997e
graphics.h.in: Properly set image pixel size when unique(x/ydata) is scalar.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Fri, 08 Oct 2010 07:33:36 -0400 |
parents | b748b86cb8c1 |
children | f0e9befd6a1c |
comparison
equal
deleted
inserted
replaced
11088:3071d909ebab | 11089:d761f0dc997e |
---|---|
3464 float pixel_size (octave_idx_type dim, const Matrix limits) | 3464 float pixel_size (octave_idx_type dim, const Matrix limits) |
3465 { | 3465 { |
3466 octave_idx_type l = dim - 1; | 3466 octave_idx_type l = dim - 1; |
3467 float dp; | 3467 float dp; |
3468 | 3468 |
3469 if (l > 0) | 3469 if (l > 0 && limits(0) != limits(1)) |
3470 dp = (limits(1) - limits(0))/(2*l); | 3470 dp = (limits(1) - limits(0))/(2*l); |
3471 else | 3471 else |
3472 { | 3472 { |
3473 if (limits(1) == limits(2)) | 3473 if (limits(1) == limits(2)) |
3474 dp = 0.5; | 3474 dp = 0.5; |