Version: HEAD (using KDE KDE 3.5.0) Installed from: Compiled From Sources OS: Linux PROBLEM: When the user creates a label and subsequently tries to move it Kst may crash STEPS TO REPRODUCE: Start Kst Create a single plot Switch to label mode Drag the mouse close to the lower left corner to create a new label In the Edit Label dialog enter a long text string (some 100 characters or so) In the Edit Label dialog Set both the margin and font size to 50 Hit OK in the Edit Label dialog Switch to layout mode Double click on the portion of the label that is visible RESUSTS: Kst crashes EXPECTED RESULTS: Kst does not crash
The essential problem here is that the size of the text label is determined not by the user but by the label text, font size, margin, etc. At the time of this size determination no check is made to ensure that the label will actually fit within its window.
SVN commit 620438 by arwalker: BUG:131697 Ensure that the child object falls within the parent. Previously this was being done only for the contentsRect of the child, which is necessarily smaller than the overall geometry of the child. This fix prevents the described crash and provides a better visual result when a label is too large to fit within its parent. M +4 -0 kstborderedviewobject.cpp --- trunk/extragear/graphics/kst/src/libkstapp/kstborderedviewobject.cpp #620437:620438 @@ -201,6 +201,10 @@ _geom.setY(rect.top() - mpb); _geom.setWidth(rect.width() + 2 * mpb); _geom.setHeight(rect.height() + 2 * mpb); + + if(_parent) { + _geom = _geom.intersect(_parent->geometry()); + } }