findMinWidth, findMaxWidth: width for a given top

Currently only implemented for Castle suffixes.
This commit is contained in:
Justin Viiret
2015-12-02 10:24:54 +11:00
committed by Matthew Barr
parent 03953f34b1
commit 8dac64d1dc
5 changed files with 53 additions and 5 deletions

View File

@@ -708,6 +708,22 @@ depth findMaxWidth(const CastleProto &proto) {
return max_width;
}
depth findMinWidth(const CastleProto &proto, u32 top) {
if (!contains(proto.repeats, top)) {
assert(0); // should not happen
return depth::infinity();
}
return proto.repeats.at(top).bounds.min;
}
depth findMaxWidth(const CastleProto &proto, u32 top) {
if (!contains(proto.repeats, top)) {
assert(0); // should not happen
return depth(0);
}
return proto.repeats.at(top).bounds.max;
}
CastleProto::CastleProto(const PureRepeat &pr) {
assert(pr.reach.any());
assert(pr.reports.size() == 1);