Changeset 586e78c in git


Ignore:
Timestamp:
28/02/15 12:06:19 (5 years ago)
Author:
Olly Betts <olly@…>
Branches:
line_contents, master, stereo, travis-osx
Children:
c0d8e5d
Parents:
cd4684a
Message:

src/export.cc: Eliminate static double factor.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    rcd4684a r586e78c  
     1Sat Feb 28 12:05:54 GMT 2015  Olly Betts <olly@survex.com>
     2
     3        * src/export.cc: Eliminate static double factor.
     4
    15Sat Feb 28 11:26:52 GMT 2015  Olly Betts <olly@survex.com>
    26
  • src/export.cc

    rcd4684a r586e78c  
    106106static double marker_size; /* for station markers */
    107107static double grid; /* grid spacing (or 0 for no grid) */
    108 static double factor;
    109108static const char *unit = "mm";
    110109const double SVG_MARGIN = 5.0; // In units of "unit".
     
    394393
    395394class Skencil : public ExportFilter {
     395    double factor;
    396396  public:
    397     Skencil() { }
     397    Skencil(double scale)
     398        : factor(POINTS_PER_MM * 1000.0 / scale) { }
    398399    const int * passes() const;
    399400    void header(const char *, const char *, time_t,
     
    551552    const char * to_close;
    552553    bool close_g;
     554    double factor;
    553555    /* for station labels */
    554556    double text_height;
     
    556558
    557559  public:
    558     SVG(double text_height_)
    559         : to_close(NULL), close_g(false), text_height(text_height_) {
     560    SVG(double scale, double text_height_)
     561        : to_close(NULL),
     562          close_g(false),
     563          factor(1000.0 / scale),
     564          text_height(text_height_) {
    560565        pending[0] = '\0';
    561566    }
     
    851856
    852857class EPS : public ExportFilter {
     858    double factor;
    853859  public:
    854     EPS() { }
     860    EPS(double scale)
     861        : factor(POINTS_PER_MM * 1000.0 / scale) { }
    855862    void header(const char *, const char *, time_t,
    856863                double min_x, double min_y, double min_z,
     
    11751182           break;
    11761183       case FMT_EPS:
    1177            filt = new EPS;
    1178            factor = POINTS_PER_MM * 1000.0 / scale;
     1184           filt = new EPS(scale);
    11791185           break;
    11801186       case FMT_GPX:
     
    11951201           break;
    11961202       case FMT_SK:
    1197            filt = new Skencil;
    1198            factor = POINTS_PER_MM * 1000.0 / scale;
     1203           filt = new Skencil(scale);
    11991204           break;
    12001205       case FMT_SVG:
    1201            filt = new SVG(text_height);
    1202            factor = 1000.0 / scale;
     1206           filt = new SVG(scale, text_height);
    12031207           break;
    12041208       default:
Note: See TracChangeset for help on using the changeset viewer.