model_server/gra/src/graWindow.h.cxx
//------------------------------------------
// auto_scroll
//
// Change the Perspective while dragging,
// so that the given coordinates are visible.
//------------------------------------------
auto_scroll
Change the Perspective while dragging,
so that the given coordinates are visible.
auto_scroll Change the Perspective while dragging so that the given coordinates are visible .
void graWindow::auto_scroll(int x, int y)
{
    Initialize(graWindow::auto_scroll);
    iv3(Perspective)& p = *perspective;
    int horz = 0, vert = 0;
    if(x < 0)
	horz = -1;
    else if(x > p.curwidth)
	horz = 1;
    if(y < 0)
	vert = -1;
    else if(y > p.curheight)
	vert = 1;
    if(horz || vert)
    {
	iv3(Perspective) s(p);
	if(horz)
	    s.curx += x - (s.curwidth * (2 + horz) / 4);
	if(vert)
	    s.cury += y - (s.curheight * (2 + vert) / 4);
	if(highlight_symbol)
	    xor_box->Erase();
	Adjust(s);
	if(highlight_symbol)
	    highlight_symbol->do_highlight(canvas, xor_box);
    }
}
void graWindow :: auto_scroll ( int x , int y ) { Initialize ( graWindow :: auto_scroll ) ; iv3 ( Perspective ) & p = * perspective ; int horz = 0 , vert = 0 ; if ( x < 0 ) horz = -1 ; else if ( x > p . curwidth ) horz = 1 ; if ( y < 0 ) vert = -1 ; else if ( y > p . curheight ) vert = 1 ; if ( horz || vert ) { iv3 ( Perspective ) s ( p ) ; if ( horz ) s . curx += x - ( s . curwidth * ( 2 + horz ) / 4 ) ; if ( vert ) s . cury += y - ( s . curheight * ( 2 + vert ) / 4 ) ; if ( highlight_symbol ) xor_box -> Erase ( ) ; Adjust ( s ) ; if ( highlight_symbol ) highlight_symbol -> do_highlight ( canvas , xor_box ) ; } }
auto_scroll
Change the Perspective while dragging,
so that the given coordinates are visible.
auto_scroll Change the Perspective while dragging so that the given coordinates are visible .