[GRASS5] [bug #2786] (grass) d.zoomed in and out too much, now can't get back exactly

Florian Goessmann florian at wallweg39.de
Wed Dec 8 04:53:48 EST 2004


On 08 Dec 2004, at 02:25, Hamish wrote:
>
> in general it is best to supply patches that highlight the changes:
>
> diff -u main.c.ORIGINAL main.c.NEW
> diff -u quit.c.ORIGINAL quit.c.NEW
>
>
> smaller and folks can quickly see what was done.
>

thanks for that! i'm new to oss development and any hint on how things 
are handled within in the community are most welcome.

after i send the message yesterday, i did some more changes. i added an 
"-l" (last) flag to d.zoom and an button to the gis manager calling it. 
it probably has some rough edges, but it basically works. to get a 
proper last extend, you got to have to use d.zoom twice before you use 
it. it is not affected by location changes other than those by d.zoom.

regards
florian

PS: quit.c is a new file, so there is nothing to diff it to. main.c and 
quit.c got to go to display/d.zoom/ the others to display/d.m/


-------------- next part --------------
A non-text attachment was scrubbed...
Name: d.m.tcl.new
Type: application/octet-stream
Size: 235 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20041208/38e3c045/d.m.tcl.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.c.new
Type: application/octet-stream
Size: 2110 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20041208/38e3c045/main.c.obj
-------------- next part --------------
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "gis.h"
#include "display.h"
#include "raster.h"
#include "local_proto.h"
#include "glocale.h"

int quit (struct Cell_head *defwin, struct Cell_head *currwin) {
  
  int screen_x, screen_y, button;
  int hand = 0;
  double ux1, uy1, ux2, uy2, ew, ns;
  
  fprintf(stderr, "\n\nButtons:\n") ;
  fprintf(stderr, "%s reset to default region\n", lefts) ;
  fprintf(stderr, "%s reset to region before d.zoom started\n", middles) ;
  fprintf(stderr, "%s Quit\n", rights) ;	
  
  R_get_location_with_pointer(&screen_x, &screen_y, &button);		
  
  if (button == leftb) {
    ew = defwin->east - defwin->west;
    ns = defwin->north - defwin->south;

    if ( ns <= defwin->ns_res ) {
      ns = 2 * defwin->ns_res;
    }

    if ( ew <= defwin->ew_res ) {
      ew = 2 * defwin->ew_res;
    }

    ux1 = defwin->east;
    ux2 = defwin->west;
    uy1 = defwin->north;
    uy2 = defwin->south;

    set_win (defwin, ux1, uy1, ux2, uy2, hand);
    return 0;
  }
 
  if (button == middleb) {
    ew = currwin->east - currwin->west;
    ns = currwin->north - currwin->south;

    if ( ns <= currwin->ns_res ) {
      ns = 2 * currwin->ns_res;
    }

    if ( ew <= currwin->ew_res ) {
      ew = 2 * currwin->ew_res;
    }

    ux1 = currwin->east;
    ux2 = currwin->west;
    uy1 = currwin->north;
    uy2 = currwin->south;

    set_win (currwin, ux1, uy1, ux2, uy2, hand);
    return 0;
  }
  
  if (button == rightb) {
    return 0;
  }
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tool.tcl.new
Type: application/octet-stream
Size: 573 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20041208/38e3c045/tool.tcl.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zoom_back.gif
Type: image/gif
Size: 104 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20041208/38e3c045/zoom_back.gif
-------------- next part --------------



More information about the grass-dev mailing list