[Kst] extragear/graphics/kst/kst
Rick Chern
rchern at interchange.ubc.ca
Sat Aug 13 00:39:20 CEST 2005
SVN commit 446248 by rchern:
resize with shift bug
M +15 -4 ksttoplevelview.cpp
--- trunk/extragear/graphics/kst/kst/ksttoplevelview.cpp #446247:446248
@@ -1569,6 +1569,7 @@
QRect KstTopLevelView::correctHeightForRatio(const QRect& oldRect, double ratio, int direction, int origRight, int origLeft) {
QRect r = oldRect;
+ printf ("orgRight = %d, origLeft = %d\n", origRight, origLeft);
if (direction & (LEFT|RIGHT)) {
int newHeight = (int)(abs(r.width())*ratio);
int negOne, negOneW;
@@ -1587,8 +1588,13 @@
r.setTop(r.bottom() - negOne*newHeight);
} else {
if (negOneW < 0) {
- r.setRight(origRight - (origLeft-origRight));
- r.setLeft(origRight);
+ if (direction & RIGHT) {
+ r.setLeft(origLeft - (origRight-origLeft));
+ r.setRight(origLeft);
+ } else {
+ r.setLeft(origRight + (origRight - origLeft));
+ r.setRight(origRight);
+ }
} else {
r.setLeft(origLeft);
r.setRight(origRight);
@@ -1599,8 +1605,13 @@
r.setBottom(r.top() + negOne*newHeight);
} else {
if (negOneW < 0) {
- r.setRight(origRight - (origLeft-origRight));
- r.setLeft(origRight);
+ if (direction & RIGHT) {
+ r.setLeft(origLeft - (origRight-origLeft));
+ r.setRight(origLeft);
+ } else {
+ r.setLeft(origRight + (origRight - origLeft));
+ r.setRight(origRight);
+ }
} else {
r.setLeft(origLeft);
r.setRight(origRight);
More information about the Kst
mailing list