Commit 147e30d2 authored by Thomas Zander's avatar Thomas Zander

new methods

svn path=/trunk/koffice/; revision=547284
parent 5025805a
......@@ -279,6 +279,33 @@ void KoShape::setAbsolutePosition(QPointF newPosition) {
setPosition(newPosition + vector1 - vector2);
}
void KoShape::copySettings(const KoShape *shape) {
m_pos = shape->position();
m_scaleX = shape->scaleX();
m_scaleY = shape->scaleY();
m_angle = shape->rotation();
m_shearX = shape->shearX();
m_shearY = shape->shearY();
m_size = shape->size();
m_connectors.clear();
foreach(QPointF point, shape->connectors())
addConnectionPoint(point);
m_zIndex = shape->zIndex();
m_visible = shape->isVisible();
m_locked = shape->isLocked();
m_keepAspect = shape->keepAspectRatio();
}
void KoShape::moveLeft(double distance) {
m_pos.setX(m_pos.x() + distance);
recalcMatrix();
}
void KoShape::moveTop(double distance) {
m_pos.setY(m_pos.y() + distance);
recalcMatrix();
}
// static
void KoShape::applyConversion(QPainter &painter, const KoViewConverter &converter) {
double zoomX, zoomY;
......
......@@ -135,6 +135,10 @@ public:
*/
void shear( double sx, double sy );
double shearX() const { return m_shearX; }
double shearY() const { return m_shearY; }
/**
* @brief Resize the shape
*
......@@ -195,6 +199,8 @@ public:
*/
void addConnectionPoint( const QPointF &point ) { m_connectors.append( point ); }
QList<QPointF> connectors() const { return m_connectors.toList(); }
/**
* Set the background of the shape.
* A QBrush can have a plain color, be fully transparant or have a complex fill.
......@@ -362,7 +368,7 @@ public:
* ratio.
* @return whether to keep aspect ratio of this shape
*/
bool keepAspectRatio() { return m_keepAspect; }
bool keepAspectRatio() const { return m_keepAspect; }
/**
* Return the position of this shape regardless of rotation/skew/scaling and regardless of
......@@ -386,6 +392,9 @@ public:
*/
void setAbsolutePosition(QPointF newPosition);
void moveLeft(double distance);
void moveTop(double distance);
protected:
QMatrix m_invMatrix;
QBrush m_backgroundBrush; ///< Stands for the background color / fill etc.
......@@ -400,6 +409,8 @@ protected:
*/
static void applyConversion(QPainter &painter, const KoViewConverter &converter);
void copySettings(const KoShape *shape);
private:
double m_scaleX;
double m_scaleY;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment