Skip to content

Commit

Permalink
issue #19 implement solution suggested by Ruslan Kabatsayev
Browse files Browse the repository at this point in the history
  • Loading branch information
dibyendumajumdar committed Jul 26, 2020
1 parent 5ef1f61 commit d39ada4
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/core/io_renderer_viewport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ namespace io
RendererViewport::RendererViewport ()
: _margin_type (MarginRatio),
_margin (math::VectorPair2 (0.13, 0.13, 0.13, 0.13)), _rows (1),
_cols (1), _pageid (0), _fov (45.), _precision (3),
_format (std::ios::floatfield)
_cols (1), _pageid (0), _fov (45.), _precision (3), _format ()
{
}

Expand Down Expand Up @@ -385,9 +384,9 @@ RendererViewport::draw_plot_data_2d (const data::Set1d &data,

std::ostringstream s;

#if 0 // FIXME
s.setf(_format);
s.precision(_precision);
#if 1 // FIXME
s.setf (_format, std::ios_base::floatfield);
s.precision (_precision);
#endif
s << p.second;

Expand Down Expand Up @@ -694,14 +693,14 @@ RendererViewport::draw_axes_tic (const RendererAxes &a, unsigned int i,
TextAlignTop | TextAlignCenter,
};

#if 0
// Following doesn't seem to work on Windows 10
std::ostringstream s;
#if 1
std::ostringstream ss;

s.setf(_format);
s.precision(_precision);
ss.setf (_format, std::ios_base::floatfield);
ss.precision (_precision);

s << (x + p[i] - a._origin[i]) / pow(10., pow10);
ss << (x + p[i] - a._origin[i]) / pow (10., pow10);
const auto s = ss.str ();
#else
// Use good old C printf - TODO check output format is correct
char temp[80];
Expand Down

0 comments on commit d39ada4

Please sign in to comment.