3
#include <grass/raster.h>
4
#include <grass/display.h>
5
#include "local_proto.h"
7
int make_window_center(struct Cell_head *window, double magnify, double east,
11
double east_west, north_south;
16
if (east < 0.0 && north < 0.0) {
17
east = (window->east + window->west) / 2.;
18
north = (window->north + window->south) / 2.;
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;
29
window->east = G_adjust_easting(window->east, window);
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);
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);