~ubuntu-branches/ubuntu/wily/grass/wily

« back to all changes in this revision

Viewing changes to display/d.zoom/center.c

Tags: 7.0.0~rc1+ds1-1~exp1
* New upstream release candidate.
* Repack upstream tarball, remove precompiled Python objects.
* Add upstream metadata.
* Update gbp.conf and Vcs-Git URL to use the experimental branch.
* Update watch file for GRASS 7.0.
* Drop build dependencies for Tcl/Tk, add build dependencies:
  python-numpy, libnetcdf-dev, netcdf-bin, libblas-dev, liblapack-dev
* Update Vcs-Browser URL to use cgit instead of gitweb.
* Update paths to use grass70.
* Add configure options: --with-netcdf, --with-blas, --with-lapack,
  remove --with-tcltk-includes.
* Update patches for GRASS 7.
* Update copyright file, changes:
  - Update copyright years
  - Group files by license
  - Remove unused license sections
* Add patches for various typos.
* Fix desktop file with patch instead of d/rules.
* Use minimal dh rules.
* Bump Standards-Version to 3.9.6, no changes.
* Use dpkg-maintscript-helper to replace directories with symlinks.
  (closes: #776349)
* Update my email to use @debian.org address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <string.h>
2
 
#include <grass/gis.h>
3
 
#include <grass/raster.h>
4
 
#include <grass/display.h>
5
 
#include "local_proto.h"
6
 
 
7
 
int make_window_center(struct Cell_head *window, double magnify, double east,
8
 
                       double north)
9
 
{
10
 
    char buffer[64];
11
 
    double east_west, north_south;
12
 
    int len_n, len_e;
13
 
 
14
 
    len_n = len_e = 0;
15
 
 
16
 
    if (east < 0.0 && north < 0.0) {
17
 
        east = (window->east + window->west) / 2.;
18
 
        north = (window->north + window->south) / 2.;
19
 
    }
20
 
 
21
 
    east_west = (window->east - window->west) / magnify;
22
 
    window->east = east + east_west / 2;
23
 
    window->west = east - east_west / 2;
24
 
    if (window->proj == PROJECTION_LL) {
25
 
        if (east_west > 360) {
26
 
            window->east = east + 180;
27
 
            window->west = east - 180;
28
 
        }
29
 
        window->east = G_adjust_easting(window->east, window);
30
 
    }
31
 
 
32
 
    north_south = (window->north - window->south) / magnify;
33
 
    window->north = north + north_south / 2;
34
 
    window->south = north - north_south / 2;
35
 
    G_limit_south(&window->south, window->proj);
36
 
    G_limit_north(&window->north, window->proj);
37
 
 
38
 
    G_format_easting(window->east, buffer, window->proj);
39
 
    G_format_easting(window->west, buffer, window->proj);
40
 
    G_format_northing(window->north, buffer, window->proj);
41
 
    G_format_northing(window->south, buffer, window->proj);
42
 
 
43
 
    return 0;
44
 
}