Fix strip optimization. It must follow paper sheet orientation settings.
--HG-- branch : develop
This commit is contained in:
parent
d5d8104d3a
commit
25fc7227f0
|
@ -115,18 +115,23 @@ void VLayoutGenerator::Generate()
|
|||
|
||||
if (bank->Prepare())
|
||||
{
|
||||
const int width = PageWidth();
|
||||
int width = PageWidth();
|
||||
int height = PageHeight();
|
||||
|
||||
if (stripOptimization)
|
||||
{
|
||||
const qreal b = bank->GetBiggestDiagonal() * multiplier + bank->GetLayoutWidth();
|
||||
|
||||
if (height >= b*2)
|
||||
auto SetStrip = [this, b](int &side)
|
||||
{
|
||||
stripOptimizationEnabled = true;
|
||||
height = qFloor(height / qFloor(height/b));
|
||||
}
|
||||
if (side >= b*2)
|
||||
{
|
||||
stripOptimizationEnabled = true;
|
||||
side = qFloor(side / qFloor(side/b));
|
||||
}
|
||||
};
|
||||
|
||||
IsPortrait() ? SetStrip(height) : SetStrip(width);
|
||||
}
|
||||
|
||||
while (bank->AllDetailsCount() > 0)
|
||||
|
@ -306,6 +311,12 @@ int VLayoutGenerator::PageWidth() const
|
|||
return static_cast<int>(paperWidth - (margins.left() + margins.right()));
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
bool VLayoutGenerator::IsPortrait() const
|
||||
{
|
||||
return PageHeight() >= PageWidth();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
void VLayoutGenerator::GatherPages()
|
||||
{
|
||||
|
|
|
@ -147,6 +147,7 @@ private:
|
|||
|
||||
int PageHeight() const;
|
||||
int PageWidth() const;
|
||||
bool IsPortrait() const;
|
||||
|
||||
void GatherPages();
|
||||
void UnitePages();
|
||||
|
|
Loading…
Reference in New Issue
Block a user