src/xscroll.c
/* Move the DisplayWindow and the ScrollButtons to a new */
/* position. newX, newY refers to the upper left corner */
/* of the LispDisplay */
Move the DisplayWindow and the ScrollButtons to a new
position. newX, newY refers to the upper left corner
of the LispDisplay
Move the DisplayWindow and the ScrollButtons to a new position . newX newY refers to the upper left corner of the LispDisplay
void Scroll(DspInterface dsp, int newX, int newY)
{
  dsp->Visible.x = bound(0, newX, dsp->Display.width - dsp->Visible.width);
  dsp->Visible.y = bound(0, newY, dsp->Display.height - dsp->Visible.height);
  newX = (int)((dsp->Visible.x * dsp->Visible.width) / dsp->Display.width);
  newY = (int)((dsp->Visible.y * dsp->Visible.height) / dsp->Display.height);
  XMoveWindow(dsp->display_id, dsp->HorScrollButton, newX, -dsp->InternalBorderWidth);
  XMoveWindow(dsp->display_id, dsp->VerScrollButton, -dsp->InternalBorderWidth, newY);
  (dsp->bitblt_to_screen)(dsp, 0, dsp->Visible.x, dsp->Visible.y, dsp->Visible.width,
                          dsp->Visible.height);
}
void Scroll ( DspInterface dsp , int newX , int newY ) { dsp -> Visible . x = bound ( 0 , newX , dsp -> Display . width - dsp -> Visible . width ) ; dsp -> Visible . y = bound ( 0 , newY , dsp -> Display . height - dsp -> Visible . height ) ; newX = ( int ) ( ( dsp -> Visible . x * dsp -> Visible . width ) / dsp -> Display . width ) ; newY = ( int ) ( ( dsp -> Visible . y * dsp -> Visible . height ) / dsp -> Display . height ) ; XMoveWindow ( dsp -> display_id , dsp -> HorScrollButton , newX , - dsp -> InternalBorderWidth ) ; XMoveWindow ( dsp -> display_id , dsp -> VerScrollButton , - dsp -> InternalBorderWidth , newY ) ; ( dsp -> bitblt_to_screen ) ( dsp , 0 , dsp -> Visible . x , dsp -> Visible . y , dsp -> Visible . width , dsp -> Visible . height ) ; }
Move the DisplayWindow and the ScrollButtons to a new
position.
Move the DisplayWindow and the ScrollButtons to a new position .
/* Limit the newX and newY values. */