Net_Owl_BC_done/Arty.cpp
/* Scale the old line coordinates to the new Xmax and Ymax coordinates.
  The new Xmax and new Ymax are passed in as parameters so we can
  calculate the scaling ratios. */
Scale the old line coordinates to the new Xmax and Ymax coordinates.
The new Xmax and new Ymax are passed in as parameters so we can
calculate the scaling ratios.
Scale the old line coordinates to the new Xmax and Ymax coordinates . The new Xmax and new Ymax are passed in as parameters so we can calculate the scaling ratios .
void TList::ScaleTo( int NewXmax, int NewYmax )
{
  int I;
  float RatioX, RatioY;
  if ((!Xmax) || (!Ymax)) { 
    Xmax = NewXmax;  Ymax = NewYmax;  ResetLines();
  } else {
    RatioX = NewXmax / Xmax;    RatioY = NewYmax / Ymax;
    X1 = X1 * RatioX;  X2 = X2 * RatioX;
    Y1 = Y1 * RatioY; Y2 = Y2 * RatioY;
    for( I = 0; I < MaxLines; I++) {
      Line[I].LX1 = Line[I].LX1 * RatioX;
      Line[I].LX2 = Line[I].LX2 * RatioX;
      Line[I].LY1 = Line[I].LY1 * RatioY;
      Line[I].LY2 = Line[I].LY2 * RatioY;
    };
  };
  Xmax = NewXmax;  Ymax = NewYmax;
}
void TList :: ScaleTo ( int NewXmax , int NewYmax ) { int I ; float RatioX , RatioY ; if ( ( ! Xmax ) || ( ! Ymax ) ) { Xmax = NewXmax ; Ymax = NewYmax ; ResetLines ( ) ; } else { RatioX = NewXmax / Xmax ; RatioY = NewYmax / Ymax ; X1 = X1 * RatioX ; X2 = X2 * RatioX ; Y1 = Y1 * RatioY ; Y2 = Y2 * RatioY ; for ( I = 0 ; I < MaxLines ; I ++ ) { Line [ I ] . LX1 = Line [ I ] . LX1 * RatioX ; Line [ I ] . LX2 = Line [ I ] . LX2 * RatioX ; Line [ I ] . LY1 = Line [ I ] . LY1 * RatioY ; Line [ I ] . LY2 = Line [ I ] . LY2 * RatioY ; } ; } ; Xmax = NewXmax ; Ymax = NewYmax ; }
Scale the old line coordinates to the new Xmax and Ymax coordinates.
Scale the old line coordinates to the new Xmax and Ymax coordinates .
/* at startup, Xmax and Ymax are zero */