Add the possibility to unset the aspect ratio again.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38796 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -263,7 +263,11 @@ void
|
|||||||
Area::SetContentAspectRatio(double ratio)
|
Area::SetContentAspectRatio(double ratio)
|
||||||
{
|
{
|
||||||
fContentAspectRatio = ratio;
|
fContentAspectRatio = ratio;
|
||||||
if (fContentAspectRatioC == NULL) {
|
if (fContentAspectRatio <= 0) {
|
||||||
|
delete fContentAspectRatioC;
|
||||||
|
fContentAspectRatioC = NULL;
|
||||||
|
}
|
||||||
|
else if (fContentAspectRatioC == NULL) {
|
||||||
fContentAspectRatioC = fLS->AddConstraint(-1.0, fLeft, 1.0, fRight,
|
fContentAspectRatioC = fLS->AddConstraint(-1.0, fLeft, 1.0, fRight,
|
||||||
ratio, fTop, -ratio, fBottom, OperatorType(EQ), 0.0);
|
ratio, fTop, -ratio, fBottom, OperatorType(EQ), 0.0);
|
||||||
fConstraints.AddItem(fContentAspectRatioC);
|
fConstraints.AddItem(fContentAspectRatioC);
|
||||||
@@ -491,7 +495,7 @@ Area::Area(BLayoutItem* item)
|
|||||||
fPreferredContentWidth(NULL),
|
fPreferredContentWidth(NULL),
|
||||||
fPreferredContentHeight(NULL),
|
fPreferredContentHeight(NULL),
|
||||||
|
|
||||||
fContentAspectRatio(0),
|
fContentAspectRatio(-1),
|
||||||
fContentAspectRatioC(NULL)
|
fContentAspectRatioC(NULL)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user