From 2adb769e33671e518f0d6c894033d19ed799cf34 Mon Sep 17 00:00:00 2001 From: Clemens Zeidler Date: Thu, 23 Sep 2010 08:05:45 +0000 Subject: [PATCH] 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 --- src/libs/alm/Area.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libs/alm/Area.cpp b/src/libs/alm/Area.cpp index e65b6894c0..a5b710fc96 100644 --- a/src/libs/alm/Area.cpp +++ b/src/libs/alm/Area.cpp @@ -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) {