Mercurial > octave
comparison libinterp/corefcn/graphics.cc @ 30887:4bab8d3fce79
maint: Merge stable to default.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 04 Apr 2022 00:20:48 -0400 |
parents | 08b08b7f05b2 05328c2145ff |
children | 32d2b6604a9f |
comparison
equal
deleted
inserted
replaced
30885:960909469245 | 30887:4bab8d3fce79 |
---|---|
692 | 692 |
693 static Matrix | 693 static Matrix |
694 convert_position (const Matrix& pos, const caseless_str& from_units, | 694 convert_position (const Matrix& pos, const caseless_str& from_units, |
695 const caseless_str& to_units, const Matrix& parent_dim) | 695 const caseless_str& to_units, const Matrix& parent_dim) |
696 { | 696 { |
697 Matrix retval (1, pos.numel ()); | 697 Matrix retval (1, pos.numel (), 0.0); |
698 double res = 0; | 698 double res = 0; |
699 bool is_rectangle = (pos.numel () == 4); | 699 bool is_rectangle = (pos.numel () == 4); |
700 bool is_2D = (pos.numel () == 2); | 700 bool is_2D = (pos.numel () == 2); |
701 | 701 |
702 if (from_units.compare ("pixels")) | 702 if (from_units.compare ("pixels")) |
827 else if (! is_2D) | 827 else if (! is_2D) |
828 retval(2) = 0; | 828 retval(2) = 0; |
829 } | 829 } |
830 } | 830 } |
831 } | 831 } |
832 else if (! is_rectangle && ! is_2D) | |
833 retval(2) = 0; | |
834 | 832 |
835 return retval; | 833 return retval; |
836 } | 834 } |
837 | 835 |
838 static Matrix | 836 static Matrix |