Summary: | Text view object resize behaviour is incorrect in some cases | ||
---|---|---|---|
Product: | [Applications] kst | Reporter: | Andrew Walker <arwalker> |
Component: | general | Assignee: | kst |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 1.x | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Andrew Walker
2006-01-27 20:01:50 UTC
Proposed patch for this problem. Index: kstviewlabel.cpp =================================================================== --- kstviewlabel.cpp (revision 503013) +++ kstviewlabel.cpp (working copy) @@ -73,7 +73,7 @@ reparse(); computeTextSize(_parsed); setDirty(false); - _autoResize = true; + setAutoResize(true); } @@ -114,7 +114,7 @@ n = n.nextSibling(); } - _autoResize = in_autoResize; + setAutoResize(in_autoResize); } @@ -491,6 +491,7 @@ void KstViewLabel::setAutoResize(bool on) { _autoResize = on; + _isResizable = !on; } Untested, but looks good to me. If it works for you, please commit to trunk. On Friday 27 January 2006 16:39, Andrew Walker wrote: [bugs.kde.org quoted mail] The current behavior is intentional, if surprising. The problem is with the definition of 'text size', which was inherited from the definition for axis labels: size 0 is supposed to mean 12 point for some default size plot (don't remember exactly what size...). If you then make the plot bigger, the label should grow. If you shrink the plot, the labels should get smaller (down to a floor size). Now, what about a label that is the child of a plot, other than axis labels? It would be surprising indeed if their size had a different definition. So, in calculating the size the font should be, we use the dimensions of the parent. If a label of text size '0' is the child of a big plot, the displayed font should be larger than if it is the parent of a small plot. (ie, parented floating labels have the same behavior as axis labels). Of course the label could be owned by things other than a plot, like an ellipse in the bug report. So..... the current behavior, at least, is usable, once understood. So the proposed patch, at least tentativly, is "not accepted=me". Barth, I think your comment was meant for 120883 and not 120884. SVN commit 503027 by arwalker: BUG:120884 No longer allow an auto-resize text label to be resized as this is a meaningless operation. M +13 -4 kstviewlabel.cpp --- trunk/extragear/graphics/kst/kst/kstviewlabel.cpp #503026:503027 @@ -73,7 +73,7 @@ reparse(); computeTextSize(_parsed); setDirty(false); - _autoResize = true; + setAutoResize(true); } @@ -114,7 +114,7 @@ n = n.nextSibling(); } - _autoResize = in_autoResize; + setAutoResize(in_autoResize); } @@ -331,7 +331,11 @@ if (p.type() == KstPainter::P_PRINT || p.type() == KstPainter::P_EXPORT) { if (_autoResize) { - adjustSizeForText(p.window()); + if (_parent) { + adjustSizeForText(_parent->geometry()); + } else { + adjustSizeForText(p.window()); + } } else { computeTextSize(_parsed); } @@ -350,7 +354,11 @@ } if (dirty()) { if (_autoResize) { - adjustSizeForText(p.window()); + if (_parent) { + adjustSizeForText(_parent->geometry()); + } else { + adjustSizeForText(p.window()); + } drawToBuffer(_parsed); } else { computeTextSize(_parsed); @@ -491,6 +499,7 @@ void KstViewLabel::setAutoResize(bool on) { _autoResize = on; + _isResizable = !on; } |