| 85 | **********************************************************************/ |
| 86 | |
| 87 | TBOX TBOX::intersection( //shared area box |
| 88 | const TBOX &box) const { |
| 89 | inT16 left; |
| 90 | inT16 bottom; |
| 91 | inT16 right; |
| 92 | inT16 top; |
| 93 | if (overlap (box)) { |
| 94 | if (box.bot_left.x () > bot_left.x ()) |
| 95 | left = box.bot_left.x (); |
| 96 | else |
| 97 | left = bot_left.x (); |
| 98 | |
| 99 | if (box.top_right.x () < top_right.x ()) |
| 100 | right = box.top_right.x (); |
| 101 | else |
| 102 | right = top_right.x (); |
| 103 | |
| 104 | if (box.bot_left.y () > bot_left.y ()) |
| 105 | bottom = box.bot_left.y (); |
| 106 | else |
| 107 | bottom = bot_left.y (); |
| 108 | |
| 109 | if (box.top_right.y () < top_right.y ()) |
| 110 | top = box.top_right.y (); |
| 111 | else |
| 112 | top = top_right.y (); |
| 113 | } |
| 114 | else { |
| 115 | left = MAX_INT16; |
| 116 | bottom = MAX_INT16; |
| 117 | top = -MAX_INT16; |
| 118 | right = -MAX_INT16; |
| 119 | } |
| 120 | return TBOX (left, bottom, right, top); |
| 121 | } |
| 122 | |
| 123 | |
| 124 | /********************************************************************** |
no test coverage detected