diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2019-03-13 19:16:12 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2019-03-13 19:16:12 (GMT) |
commit | 913c2ffec66a261d7cea357c21cdcda60132c0a5 (patch) | |
tree | 50834dfff8ea8a4494f981b6559bbfa604ee7707 /generic/tkCanvWind.c | |
parent | 87a95ec0329c9fd676ed4a5d9d10247eb245a4ec (diff) | |
download | tk-913c2ffec66a261d7cea357c21cdcda60132c0a5.zip tk-913c2ffec66a261d7cea357c21cdcda60132c0a5.tar.gz tk-913c2ffec66a261d7cea357c21cdcda60132c0a5.tar.bz2 |
Document. Factor out basic rotation function.
Diffstat (limited to 'generic/tkCanvWind.c')
-rw-r--r-- | generic/tkCanvWind.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/generic/tkCanvWind.c b/generic/tkCanvWind.c index 8c44a6c..9f38932 100644 --- a/generic/tkCanvWind.c +++ b/generic/tkCanvWind.c @@ -943,12 +943,9 @@ RotateWinItem( double angleRad) /* Amount by which item is to be rotated. */ { WindowItem *winItemPtr = (WindowItem *) itemPtr; - double s = sin(angleRad), c = cos(angleRad); - double x = winItemPtr->x - originX; - double y = winItemPtr->y - originY; - winItemPtr->x = originX + x * c - y * s; - winItemPtr->y = originY + x * s + y * c; + TkRotatePoint(originX, originY, sin(angleRad), cos(angleRad), + &winItemPtr->x, &winItemPtr->y); ComputeWindowBbox(canvas, winItemPtr); } |