Changeset 76cf7f1 in git for src/kml.cc


Ignore:
Timestamp:
04/09/19 02:27:11 (6 weeks ago)
Author:
Olly Betts <olly@…>
Branches:
master
Children:
7061908
Parents:
6363690
Message:

Fix rotated exports

When exporting to a format where we support rotation in the horizontal
plane (such as SVG), the rotation was incorrectly applied to cross
section data (except for the default rotation of zero).

Fixes #108, reported by Richard Knapp.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/kml.cc

    r6363690 r76cf7f1  
    33 */
    44/* Copyright (C) 2012 Olaf Kähler
    5  * Copyright (C) 2012,2013,2014,2015,2016,2017,2018 Olly Betts
     5 * Copyright (C) 2012,2013,2014,2015,2016,2017,2018,2019 Olly Betts
    66 *
    77 * This program is free software; you can redistribute it and/or modify
     
    166166    double c = cos(rad(angle));
    167167
    168     double x1 = p->x + c * d1;
    169     double y1 = p->y + s * d1;
     168    double x1 = p->x + s * d1;
     169    double y1 = p->y + c * d1;
    170170    double z1 = p->z;
    171171    pj_transform(pj_input, pj_output, 1, 1, &x1, &y1, &z1);
     
    173173    y1 = deg(y1);
    174174
    175     double x2 = p->x - c * d2;
    176     double y2 = p->y - s * d2;
     175    double x2 = p->x - s * d2;
     176    double y2 = p->y - c * d2;
    177177    double z2 = p->z;
    178178    pj_transform(pj_input, pj_output, 1, 1, &x2, &y2, &z2);
     
    195195    double c = cos(rad(angle));
    196196
    197     double x = p->x + c * d;
    198     double y = p->y + s * d;
     197    double x = p->x + s * d;
     198    double y = p->y + c * d;
    199199    double z = p->z;
    200200    pj_transform(pj_input, pj_output, 1, 1, &x, &y, &z);
     
    219219    double c = cos(rad(angle));
    220220
    221     double x1 = p->x + c * d1;
    222     double y1 = p->y + s * d1;
     221    double x1 = p->x + s * d1;
     222    double y1 = p->y + c * d1;
    223223    double z1 = p->z;
    224224    pj_transform(pj_input, pj_output, 1, 1, &x1, &y1, &z1);
     
    226226    y1 = deg(y1);
    227227
    228     double x2 = p->x - c * d2;
    229     double y2 = p->y - s * d2;
     228    double x2 = p->x - s * d2;
     229    double y2 = p->y - c * d2;
    230230    double z2 = p->z;
    231231    pj_transform(pj_input, pj_output, 1, 1, &x2, &y2, &z2);
Note: See TracChangeset for help on using the changeset viewer.