[Kst] kdeextragear-2/kst/kst
Andrew Walker
arwalker at sumusltd.com
Tue Aug 24 02:32:31 CEST 2004
CVS commit by arwalker:
Better alignment.
M +23 -13 kstalignment.cpp 1.4
--- kdeextragear-2/kst/kst/kstalignment.cpp #1.3:1.4
@@ -50,4 +50,6 @@ void KstAlignment::setPosition(const QRe
QPoint xPlotRegion;
QPoint yPlotRegion;
+ QPoint xPlotRegionCurrent;
+ QPoint yPlotRegionCurrent;
xAllRegion.setX(geometry.left());
@@ -62,22 +64,30 @@ void KstAlignment::setPosition(const QRe
if (_xAlignments.contains(xAllRegion)) {
- if (xAllRegion.x() < _xAlignments[xAllRegion].x()) {
- xAllRegion.setX(_xAlignments[xAllRegion].x());
- }
- if (xAllRegion.y() > _xAlignments[xAllRegion].y()) {
- xAllRegion.setY(_xAlignments[xAllRegion].y());
+ xPlotRegionCurrent = _xAlignments[xAllRegion];
+
+ if (xPlotRegion.x() > xPlotRegionCurrent.x()) {
+ xPlotRegionCurrent.setX(xPlotRegion.x());
}
+ if (xPlotRegion.y() < xPlotRegionCurrent.y()) {
+ xPlotRegionCurrent.setY(xPlotRegion.y());
}
+ _xAlignments.insert(xAllRegion, xPlotRegionCurrent);
+ } else {
_xAlignments.insert(xAllRegion, xPlotRegion);
+ }
if (_yAlignments.contains(yAllRegion)) {
- if (yAllRegion.x() < _yAlignments[yAllRegion].x()) {
- xAllRegion.setX(_xAlignments[yAllRegion].x());
- }
- if (yAllRegion.y() > _yAlignments[yAllRegion].y()) {
- yAllRegion.setY(_yAlignments[yAllRegion].y());
+ yPlotRegionCurrent = _yAlignments[yAllRegion];
+
+ if (yPlotRegion.x() > yPlotRegionCurrent.x()) {
+ yPlotRegionCurrent.setX(yPlotRegion.x());
}
+ if (yPlotRegion.y() > yPlotRegionCurrent.y()) {
+ yPlotRegionCurrent.setY(yPlotRegion.y());
}
+ _yAlignments.insert(yAllRegion, yPlotRegionCurrent);
+ } else {
_yAlignments.insert(yAllRegion, yPlotRegion);
+ }
}
More information about the Kst
mailing list