Computes and sets the type_ and first_column_, last_column_ and column_set_. resolution refers to the ppi resolution of the image.
| 979 | // Computes and sets the type_ and first_column_, last_column_ and column_set_. |
| 980 | // resolution refers to the ppi resolution of the image. |
| 981 | void ColPartition::SetPartitionType(int resolution, ColPartitionSet* columns) { |
| 982 | int first_spanned_col = -1; |
| 983 | ColumnSpanningType span_type = |
| 984 | columns->SpanningType(resolution, |
| 985 | bounding_box_.left(), bounding_box_.right(), |
| 986 | MIN(bounding_box_.height(), bounding_box_.width()), |
| 987 | MidY(), left_margin_, right_margin_, |
| 988 | &first_column_, &last_column_, |
| 989 | &first_spanned_col); |
| 990 | column_set_ = columns; |
| 991 | if (first_column_ < last_column_ && span_type == CST_PULLOUT && |
| 992 | !IsLineType()) { |
| 993 | // Unequal columns may indicate that the pullout spans one of the columns |
| 994 | // it lies in, so force it to be allocated to just that column. |
| 995 | if (first_spanned_col >= 0) { |
| 996 | first_column_ = first_spanned_col; |
| 997 | last_column_ = first_spanned_col; |
| 998 | } else { |
| 999 | if ((first_column_ & 1) == 0) |
| 1000 | last_column_ = first_column_; |
| 1001 | else if ((last_column_ & 1) == 0) |
| 1002 | first_column_ = last_column_; |
| 1003 | else |
| 1004 | first_column_ = last_column_ = (first_column_ + last_column_) / 2; |
| 1005 | } |
| 1006 | } |
| 1007 | type_ = PartitionType(span_type); |
| 1008 | } |
| 1009 | |
| 1010 | // Returns the PartitionType from the current BlobRegionType and a column |
| 1011 | // flow spanning type ColumnSpanningType, generated by |
no test coverage detected