From 58b0e69b7336a8a06c447cf786f73df903120e53 Mon Sep 17 00:00:00 2001 From: MenTaLguY Date: Sun, 11 Mar 2007 19:57:07 +0000 Subject: Switch selection bounds and center to use NR::Maybe, addressing most of the recent bbox regressions. (bzr r2604) --- src/dialogs/tiledialog.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/dialogs/tiledialog.cpp') diff --git a/src/dialogs/tiledialog.cpp b/src/dialogs/tiledialog.cpp index b10f952da..75311ddd0 100644 --- a/src/dialogs/tiledialog.cpp +++ b/src/dialogs/tiledialog.cpp @@ -268,14 +268,14 @@ void TileDialog::Grid_Arrange () } + NR::Maybe sel_bbox = selection->bounds(); // Fit to bbox, calculate padding between rows accordingly. - if (!SpaceManualRadioButton.get_active()){ - NR::Rect b = selection->bounds(); + if ( sel_bbox && !SpaceManualRadioButton.get_active() ){ #ifdef DEBUG_GRID_ARRANGE g_print("\n row = %f col = %f selection x= %f selection y = %f", total_row_height,total_col_width, b.extent(NR::X), b.extent(NR::Y)); #endif - paddingx = (b.extent(NR::X) - total_col_width) / (NoOfCols -1); - paddingy = (b.extent(NR::Y) - total_row_height) / (NoOfRows -1); + paddingx = (sel_bbox->extent(NR::X) - total_col_width) / (NoOfCols -1); + paddingy = (sel_bbox->extent(NR::Y) - total_row_height) / (NoOfRows -1); } /* -- cgit v1.2.3