Commit 0bbe369b authored by Thomas Zander's avatar Thomas Zander

Alter the signature of KoShape::paintDecorations to allow it

to access more info.  More specifically; you can now access
the KoCanvasResourceProvider.

svn path=/trunk/koffice/; revision=632015
parent e5dbc068
......@@ -103,7 +103,8 @@ KoShape::~KoShape()
delete d;
}
void KoShape::paintDecorations(QPainter &painter, const KoViewConverter &converter, bool selected) {
void KoShape::paintDecorations(QPainter &painter, const KoViewConverter &converter, const KoCanvasBase *canvas) {
/* Since this code is not actually used (kivio is going to be the main user) lets disable instead of fix.
if ( selected )
{
// draw connectors
......@@ -117,7 +118,7 @@ void KoShape::paintDecorations(QPainter &painter, const KoViewConverter &convert
painter.drawLine( QPointF( p.x() - 2, p.y() + 2 ), QPointF( p.x() + 2, p.y() - 2 ) );
painter.drawLine( QPointF( p.x() + 2, p.y() + 2 ), QPointF( p.x() - 2, p.y() - 2 ) );
}
}
}*/
}
void KoShape::scale( double sx, double sy )
......
......@@ -45,6 +45,7 @@ class KoShapeUserData;
class KoViewConverter;
class KoShapeApplicationData;
class KoShapePrivate;
class KoCanvasBase;
/**
*
......@@ -108,7 +109,7 @@ public:
* @param selected true if the shape is currently selected
* @param converter to convert between internal and view coordinates.
*/
virtual void paintDecorations(QPainter &painter, const KoViewConverter &converter, bool selected);
virtual void paintDecorations(QPainter &painter, const KoViewConverter &converter, const KoCanvasBase *canvas);
/**
* @brief Scale the shape using the zero-point which is the top-left corner.
......
......@@ -161,7 +161,7 @@ void KoShapeManager::paint( QPainter &painter, const KoViewConverter &converter,
if(! forPrint) {
painter.save();
painter.setRenderHint( QPainter::Antialiasing, false );
shape->paintDecorations( painter, converter, m_selection->isSelected(shape) );
shape->paintDecorations( painter, converter, m_canvas );
painter.restore();
}
painter.restore(); // for the matrix
......
......@@ -42,16 +42,6 @@ void KoFormulaShape::paint( QPainter &painter, const KoViewConverter &converter
m_formulaRenderer->paintElement( painter, m_formulaElement ); // paint the formula
}
void KoFormulaShape::paintDecorations( QPainter &painter,
const KoViewConverter &converter, bool selected )
{
Q_UNUSED( painter )
Q_UNUSED( converter )
Q_UNUSED( selected )
// TODO how to highlight things?? do we need it btw?
}
BasicElement* KoFormulaShape::elementAt( const QPointF& p )
{
return m_formulaElement->childElementAt( p );
......
......@@ -47,10 +47,6 @@ public:
/// inherited from KoShape
void paint( QPainter &painter, const KoViewConverter &converter );
/// inherited from KoShape
void paintDecorations( QPainter &painter, const KoViewConverter &converter,
bool selected );
/// @return The element at the point @p p
BasicElement* elementAt( const QPointF& p );
......
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