From fcccd3471fd3defdc5c10ca5ed096a56015c2467 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 27 Jun 2013 16:37:19 +0300 Subject: [PATCH] Fix some alignment issues in LinearArrangement --- source/lineararrangement.cpp | 9 ++++++--- source/lineararrangement.h | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/source/lineararrangement.cpp b/source/lineararrangement.cpp index 9e6441a..5d18cfb 100644 --- a/source/lineararrangement.cpp +++ b/source/lineararrangement.cpp @@ -38,13 +38,13 @@ void LinearArrangement::process_widget(Widget &wdg, Side side, bool aligned) { if(side==opposite) { - bool snug = (edges[primary].aligned && aligned && !split_here); + bool snug = (internal_aligned && aligned && !split_here); add_constraint(wdg, get_order_constraint(primary, !snug), primary); if(first) - edges[side].add(wdg, aligned); + edges[side].add(wdg, (aligned && gravity==opposite)); } else if(side==primary) - next.add(wdg, (aligned && gravity==primary)); + next.add(wdg, aligned); else { if(edges[side].aligned && aligned) @@ -55,6 +55,9 @@ void LinearArrangement::process_widget(Widget &wdg, Side side, bool aligned) void LinearArrangement::finish_slot() { + internal_aligned = next.aligned; + if(gravity!=primary) + next.aligned = false; edges[primary] = next; next.clear(); split_here = false; diff --git a/source/lineararrangement.h b/source/lineararrangement.h index 3fd5ef7..a18c849 100644 --- a/source/lineararrangement.h +++ b/source/lineararrangement.h @@ -26,6 +26,7 @@ protected: bool first; bool split_here; Side gravity; + bool internal_aligned; LinearArrangement(Layout &, Side); -- 2.45.2