Skip to content

Instantly share code, notes, and snippets.

@wez
Created June 26, 2011 18:25
Show Gist options
  • Save wez/1047826 to your computer and use it in GitHub Desktop.
Save wez/1047826 to your computer and use it in GitHub Desktop.
tweaks for qcachegrind
Index: libviews/treemap.cpp
===================================================================
--- libviews/treemap.cpp (revision 1238414)
+++ libviews/treemap.cpp (working copy)
@@ -368,9 +368,12 @@
while(qAbs(maxWidth - usedWidth) > 3 * fm->maxWidth()) {
int halfPos = (bottomPos + breakPos)/2;
int halfWidth = fm->width(text, halfPos);
- if (halfWidth < maxWidth)
+ if (halfWidth < maxWidth) {
bottomPos = halfPos;
- else {
+ if (usedWidth > maxWidth) {
+ usedWidth--;
+ }
+ } else {
breakPos = halfPos;
usedWidth = halfWidth;
}
@wez
Copy link
Author

wez commented Jun 26, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment