logging-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject svn commit: r935303 - /logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/TableColorizingRenderer.java
Date Sun, 18 Apr 2010 05:57:09 GMT
Author: sdeboy
Date: Sun Apr 18 05:57:09 2010
New Revision: 935303

URL: http://svn.apache.org/viewvc?rev=935303&view=rev
Log:
Fixed performance issue - multi-line row mode was updating row heights even if they hadn't
changed

Modified:
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/TableColorizingRenderer.java

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/TableColorizingRenderer.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/TableColorizingRenderer.java?rev=935303&r1=935302&r2=935303&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/TableColorizingRenderer.java
(original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/TableColorizingRenderer.java
Sun Apr 18 05:57:09 2010
@@ -183,7 +183,7 @@ public class TableColorizingRenderer ext
             paramMap.put(TextAttribute.FONT, msgRenderer.getFont());
             int preferredHeight = calculateHeight(table.getGraphics(), string, width, paramMap);
             if(preferredHeight != tableRowHeight) {
-                table.setRowHeight(row, Math.max(preferredHeight, ChainsawConstants.DEFAULT_ROW_HEIGHT));
+                table.setRowHeight(row, preferredHeight);
             }
             msgRenderer.setText(string);
         } else {
@@ -374,7 +374,7 @@ public class TableColorizingRenderer ext
          float layoutHeight = layout.getAscent() + layout.getDescent() + layout.getLeading()
+ 1;
          height += layoutHeight;
      }
-     //pad total by 4
-     return (int) height + 4;
+     //pad total by 4 or default row height
+     return Math.max(ChainsawConstants.DEFAULT_ROW_HEIGHT, (int) height + 4);
     }
 }



Mime
View raw message