| 130 | */ |
| 131 | |
| 132 | void BLOCK::compress() { // squash it up |
| 133 | #define ROW_SPACING 5 |
| 134 | |
| 135 | ROW_IT row_it(&rows); |
| 136 | ROW *row; |
| 137 | ICOORD row_spacing (0, ROW_SPACING); |
| 138 | |
| 139 | ICOORDELT_IT icoordelt_it; |
| 140 | |
| 141 | sort_rows(); |
| 142 | |
| 143 | box = TBOX (box.topleft (), box.topleft ()); |
| 144 | box.move_bottom_edge (ROW_SPACING); |
| 145 | for (row_it.mark_cycle_pt (); !row_it.cycled_list (); row_it.forward ()) { |
| 146 | row = row_it.data (); |
| 147 | row->move (box.botleft () - row_spacing - |
| 148 | row->bounding_box ().topleft ()); |
| 149 | box += row->bounding_box (); |
| 150 | } |
| 151 | |
| 152 | leftside.clear (); |
| 153 | icoordelt_it.set_to_list (&leftside); |
| 154 | icoordelt_it.add_to_end (new ICOORDELT (box.left (), box.bottom ())); |
| 155 | icoordelt_it.add_to_end (new ICOORDELT (box.left (), box.top ())); |
| 156 | rightside.clear (); |
| 157 | icoordelt_it.set_to_list (&rightside); |
| 158 | icoordelt_it.add_to_end (new ICOORDELT (box.right (), box.bottom ())); |
| 159 | icoordelt_it.add_to_end (new ICOORDELT (box.right (), box.top ())); |
| 160 | } |
| 161 | |
| 162 | |
| 163 | /** |
nothing calls this directly
no test coverage detected