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:
Clemens Zeidler
2010-09-23 08:05:45 +00:00
parent 19ddd4f1cb
commit 2adb769e33
+6 -2
View File
@@ -263,7 +263,11 @@ void
Area::SetContentAspectRatio(double 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,
ratio, fTop, -ratio, fBottom, OperatorType(EQ), 0.0);
fConstraints.AddItem(fContentAspectRatioC);
@@ -491,7 +495,7 @@ Area::Area(BLayoutItem* item)
fPreferredContentWidth(NULL),
fPreferredContentHeight(NULL),
fContentAspectRatio(0),
fContentAspectRatio(-1),
fContentAspectRatioC(NULL)
{