47
37
void KstAlignment::setPosition(const QRect& geometry, const QRect& plotRegion) {
52
QPoint xPlotRegionCurrent;
53
QPoint yPlotRegionCurrent;
55
xAllRegion.setX(geometry.left());
56
xAllRegion.setY(geometry.right());
57
yAllRegion.setX(geometry.top());
58
yAllRegion.setY(geometry.bottom());
60
xPlotRegion.setX(plotRegion.left());
61
xPlotRegion.setY(plotRegion.right());
62
yPlotRegion.setX(plotRegion.top());
63
yPlotRegion.setY(plotRegion.bottom());
38
QPoint xAllRegion(geometry.left(), geometry.right());
39
QPoint yAllRegion(geometry.top(), geometry.bottom());
40
QPoint xPlotRegion(plotRegion.left(), plotRegion.right());
41
QPoint yPlotRegion(plotRegion.top(), plotRegion.bottom());
65
43
if (_xAlignments.contains(xAllRegion)) {
66
xPlotRegionCurrent = _xAlignments[xAllRegion];
44
QPoint xPlotRegionCurrent = _xAlignments[xAllRegion];
68
46
if (xPlotRegion.x() > xPlotRegionCurrent.x()) {
69
47
xPlotRegionCurrent.setX(xPlotRegion.x());
95
73
void KstAlignment::limits(const QRect& geometry, double& xleft, double& xright, double& ytop, double& ybottom, double dFactor) {
99
xAllRegion.setX(geometry.left());
100
xAllRegion.setY(geometry.right());
101
yAllRegion.setX(geometry.top());
102
yAllRegion.setY(geometry.bottom());
104
if (_xAlignments.contains(xAllRegion)) {
105
xleft = (double)_xAlignments[xAllRegion].x();
106
xright = (double)_xAlignments[xAllRegion].y();
74
QPoint xAllRegion(geometry.left(), geometry.right());
75
QPoint yAllRegion(geometry.top(), geometry.bottom());
77
alignmentMap::ConstIterator allRef = _xAlignments.find(xAllRegion);
78
if (allRef != _xAlignments.end()) {
79
xleft = double((*allRef).x()) * dFactor;
80
xright = double((*allRef).y()) * dFactor;
112
if (_yAlignments.contains(yAllRegion)) {
113
ytop = (double)_yAlignments[yAllRegion].x();
114
ybottom = (double)_yAlignments[yAllRegion].y();
86
allRef = _yAlignments.find(yAllRegion);
87
if (allRef != _yAlignments.end()) {
88
ytop = double((*allRef).x()) * dFactor;
89
ybottom = double((*allRef).y()) * dFactor;
127
97
QRect KstAlignment::limits(const QRect& geometry) {
98
QPoint xAllRegion(geometry.left(), geometry.right());
99
QPoint yAllRegion(geometry.top(), geometry.bottom());
130
100
QRect plotRegion;
132
xAllRegion.setX(geometry.left());
133
xAllRegion.setY(geometry.right());
134
yAllRegion.setX(geometry.top());
135
yAllRegion.setY(geometry.bottom());
137
if (_xAlignments.contains(xAllRegion)) {
138
plotRegion.setLeft(_xAlignments[xAllRegion].x());
139
plotRegion.setRight(_xAlignments[xAllRegion].y());
102
alignmentMap::ConstIterator allRef = _xAlignments.find(xAllRegion);
103
if (allRef != _xAlignments.end()) {
104
plotRegion.setLeft((*allRef).x());
105
plotRegion.setRight((*allRef).y());
141
107
plotRegion.setLeft(0);
142
108
plotRegion.setRight(0);
145
if (_yAlignments.contains(yAllRegion)) {
146
plotRegion.setTop(_yAlignments[yAllRegion].x());
147
plotRegion.setBottom(_yAlignments[yAllRegion].y());
111
allRef = _yAlignments.find(yAllRegion);
112
if (allRef != _yAlignments.end()) {
113
plotRegion.setTop((*allRef).x());
114
plotRegion.setBottom((*allRef).y());
149
116
plotRegion.setTop(0);
150
117
plotRegion.setBottom(0);