From 76a7cd9ed443c1a6451e6fab98f428f7cce48eed Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 27 Nov 2012 23:52:39 +0200 Subject: [PATCH] Don't try to solve if container is smaller than its margins Attempting that would cause unsigneds to wrap around to very large values and cause a weird solution. --- source/layout.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/layout.cpp b/source/layout.cpp index 34afd72..f89e407 100644 --- a/source/layout.cpp +++ b/source/layout.cpp @@ -232,6 +232,10 @@ void Layout::solve_constraints(int dir) { Pointers &ptrs = pointers[dir&VERTICAL]; + const Geometry &geom = container->get_geometry(); + if(geom.*(ptrs.dim)index*5] = 1; row[(*i)->index*5+1] = 1; row[(*i)->index*5+3] = 1; - row.back() = container->get_geometry().*(ptrs.dim)-margin.*(ptrs.high_margin); + row.back() = geom.*(ptrs.dim)-margin.*(ptrs.high_margin); } { -- 2.43.0