lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 1612829 3/6: Investigate failure of the asser


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 1612829 3/6: Investigate failure of the assertion just added
Date: Wed, 22 Aug 2018 19:18:24 -0400 (EDT)

branch: master
commit 16128296ede3584f4c56967a66c2477f6b51df44
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Investigate failure of the assertion just added
    
    Added temporary instrumentation. It shows that strings in super-headers
    typically either fit in the intended rectangle, or exceed it slightly:
    e.g., 104 points of text in a rectangle of width 94.
---
 wx_table_generator.cpp | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/wx_table_generator.cpp b/wx_table_generator.cpp
index f7ee1df..a361d0b 100644
--- a/wx_table_generator.cpp
+++ b/wx_table_generator.cpp
@@ -23,6 +23,7 @@
 
 #include "wx_table_generator.hpp"
 
+#include "alert.hpp"
 #include "assert_lmi.hpp"
 #include "miscellany.hpp"               // count_newlines(), split_into_lines()
 #include "ssize_lmi.hpp"
@@ -216,7 +217,17 @@ void wx_table_generator::output_super_header
 
     for(auto const& i : lines)
         {
-        LMI_ASSERT(dc().GetTextExtent(i).x <= rect.width);
+//      LMI_ASSERT(dc().GetTextExtent(i).x <= rect.width);
+        if(rect.width < dc().GetTextExtent(i).x)
+            {
+            warning()
+                << "Super-header transgresses its rectangle:\n"
+                << "'" << i << "' super-header text\n"
+                << dc().GetTextExtent(i).x << " dc().GetTextExtent(i).x\n"
+                << rect.width << " rect.width\n"
+                << LMI_FLUSH
+                ;
+            }
         dc_.DrawLabel(i, rect, wxALIGN_CENTER_HORIZONTAL);
         rect.y += row_height_;
         pos_y  += row_height_;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]