1 /** 2 ** usercord.h 3 ** 4 ** Copyright (C) 1992, Csaba Biegl 5 ** 820 Stirrup Dr, Nashville, TN, 37221 6 ** csaba@vuse.vanderbilt.edu 7 ** 8 ** This file is part of the GRX graphics library. 9 ** 10 ** The GRX graphics library is free software; you can redistribute it 11 ** and/or modify it under some conditions; see the "copying.grx" file 12 ** for details. 13 ** 14 ** This library is distributed in the hope that it will be useful, 15 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 16 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 17 ** 18 **/ 19 20 #include "usrscale.h" 21 22 #define U2SX(x,c) \ 23 SCALE(x,((x) - (c)->gc_usrxbase),(c)->gc_xmax,(c)->gc_usrwidth) 24 #define U2SY(y,c) \ 25 SCALE(y,((y) - (c)->gc_usrybase),(c)->gc_ymax,(c)->gc_usrheight) 26 27 #define S2UX(x,c) do { \ 28 SCALE(x,x,(c)->gc_usrwidth,(c)->gc_xmax); \ 29 (x) += (c)->gc_usrxbase; \ 30 } while(0) 31 32 #define S2UY(y,c) do { \ 33 SCALE(y,y,(c)->gc_usrheight,(c)->gc_ymax); \ 34 (y) += (c)->gc_usrybase; \ 35 } while(0) 36