Fix missing min frame border
* Previously only considered min border if the current border is smaller * Need to consider as long as min size is enabled
This commit is contained in:
parent
a54aacca3f
commit
f8cde10662
@ -442,12 +442,8 @@ Dimensions Framing::computeRelativeImageBBoxInFrame(const Dimensions& imgSize,
|
|||||||
double minBorderOther = static_cast<double>(
|
double minBorderOther = static_cast<double>(
|
||||||
side == Side::WIDTH ? framing.minHeight : framing.minWidth);
|
side == Side::WIDTH ? framing.minHeight : framing.minWidth);
|
||||||
|
|
||||||
if (borderOther < minBorderOther) {
|
maxImageOther = std::floor(frameOther - 2.0 * minBorderOther);
|
||||||
maxImageOther = std::floor(frameOther - 2.0 * minBorderOther);
|
maxImageBasis = std::floor(frameBasis - 2.0 * minBorderBasis);
|
||||||
}
|
|
||||||
if (borderBasis < minBorderBasis) {
|
|
||||||
maxImageBasis = std::floor(frameBasis - 2.0 * minBorderBasis);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Image is too large to satisfy requirements:
|
// Image is too large to satisfy requirements:
|
||||||
@ -524,10 +520,8 @@ Dimensions Framing::computeUniformRelativeImageBBox(const Dimensions& imgSize,
|
|||||||
double minBorder = static_cast<double>(
|
double minBorder = static_cast<double>(
|
||||||
side == Side::WIDTH ? framing.minWidth : framing.minHeight);
|
side == Side::WIDTH ? framing.minWidth : framing.minHeight);
|
||||||
|
|
||||||
if (border < minBorder) {
|
maxImageBasis = std::floor(frameBasis - 2.0 * minBorder);
|
||||||
maxImageBasis = std::floor(frameBasis - 2.0 * minBorder);
|
maxImageOther = std::floor(frameOther - 2.0 * minBorder);
|
||||||
maxImageOther = std::floor(frameOther - 2.0 * minBorder);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (imgOther > maxImageOther) {
|
if (imgOther > maxImageOther) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user