diff options
Diffstat (limited to 'src/FbTk/Text.hh')
-rw-r--r-- | src/FbTk/Text.hh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/FbTk/Text.hh b/src/FbTk/Text.hh index ceb0f19..5336546 100644 --- a/src/FbTk/Text.hh +++ b/src/FbTk/Text.hh | |||
@@ -75,6 +75,31 @@ inline void translateCoords(Orientation orient, int &x, int &y, unsigned int w, | |||
75 | 75 | ||
76 | } | 76 | } |
77 | 77 | ||
78 | // still require w and h in ROT0 coords | ||
79 | inline void untranslateCoords(Orientation orient, int &orig_x, int &orig_y, unsigned int w, unsigned int h) { | ||
80 | |||
81 | int x = orig_x; | ||
82 | int y = orig_y; | ||
83 | |||
84 | switch(orient) { | ||
85 | case ROT0: | ||
86 | break; | ||
87 | case ROT90: | ||
88 | orig_y = h - x; | ||
89 | orig_x = y; | ||
90 | break; | ||
91 | case ROT180: | ||
92 | orig_x = w - x; | ||
93 | orig_y = h - y; | ||
94 | break; | ||
95 | case ROT270: | ||
96 | orig_y = x; | ||
97 | orig_x = w - y; | ||
98 | break; | ||
99 | } | ||
100 | |||
101 | } | ||
102 | |||
78 | // When positioning an X11 box inside another area, we need to | 103 | // When positioning an X11 box inside another area, we need to |
79 | // relocate the x,y coordinates | 104 | // relocate the x,y coordinates |
80 | inline void translatePosition(Orientation orient, int &x, int &y, unsigned int w, unsigned int h, unsigned int bw) { | 105 | inline void translatePosition(Orientation orient, int &x, int &y, unsigned int w, unsigned int h, unsigned int bw) { |