24 #include "KDChartAbstractArea_p.h"
31 #include <KDABLibFakes>
34 using namespace KDChart;
38 AbstractArea::Private::Private() :
45 AbstractArea::Private::~Private()
51 AbstractArea::AbstractArea()
65 void AbstractArea::init()
67 d->amountOfLeftOverlap = 0;
68 d->amountOfRightOverlap = 0;
69 d->amountOfTopOverlap = 0;
70 d->amountOfBottomOverlap = 0;
78 if ( ! doNotRecalculate )
80 return d->amountOfLeftOverlap;
86 if ( ! doNotRecalculate )
88 return d->amountOfRightOverlap;
94 if ( ! doNotRecalculate )
96 return d->amountOfTopOverlap;
102 if ( ! doNotRecalculate )
104 return d->amountOfBottomOverlap;
110 const QRect oldGeometry( geometry() );
111 if ( oldGeometry != rect )
113 painter.translate( rect.left(), rect.top() );
115 painter.translate( -rect.left(), -rect.top() );
116 if ( oldGeometry != rect )
117 setGeometry( oldGeometry );
123 const QRect overlappingArea( geometry().adjusted( -
d->amountOfLeftOverlap, -
d->amountOfTopOverlap,
124 d->amountOfRightOverlap,
d->amountOfBottomOverlap ) );
132 inner.moveTo( oldGeometry.left() + inner.left(), oldGeometry.top() + inner.top() );
133 const bool needAdjustGeometry = oldGeometry != inner;
134 if ( needAdjustGeometry ) {
136 bool prevSignalBlocked = signalsBlocked();
137 blockSignals(
true );
138 setGeometry( inner );
139 blockSignals( prevSignalBlocked );
142 if ( needAdjustGeometry ) {
143 bool prevSignalBlocked = signalsBlocked();
144 blockSignals(
true );
145 setGeometry( oldGeometry );
146 blockSignals( prevSignalBlocked );