Commit d924922f authored by Emanuele Tamponi's avatar Emanuele Tamponi

Fixed selection of previously drawn shapes.

svn path=/trunk/koffice/; revision=659176
parent fddce65d
......@@ -46,6 +46,7 @@
#include "kis_opengl_canvas2.h"
#include "kis_group_layer.h"
#include "kis_opengl_image_context.h"
#include "kis_shape_controller.h"
#ifdef HAVE_OPENGL
#include <QGLFormat>
......@@ -196,6 +197,9 @@ void KisCanvas2::addCommand(QUndoCommand *command)
KoShapeManager* KisCanvas2::shapeManager() const
{
KoShape *shape = dynamic_cast<KisShapeController*>(m_d->view->document()->shapeController())->activeLayerShape();
if (shape->shapeId() == KIS_SHAPE_LAYER_ID)
return dynamic_cast<KisShapeLayer*>(shape)->shapeManager();
return m_d->shapeManager;
}
......
......@@ -50,6 +50,8 @@ public:
void setInitialShapeForView( KisView2 * view );
KoShape * activeLayerShape();
private slots:
// These slots keep track of changes in the layer stack and make
......@@ -60,10 +62,10 @@ private slots:
void slotLayersChanged( KisGroupLayerSP rootLayer );
void slotLayerActivated( KisLayerSP layer );
// XXX: The same is necessary for selections, masks etc.
private:
KoShape * activeLayerShape();
// // XXX: The same is necessary for selections, masks etc.
// private:
//
// KoShape * activeLayerShape();
private:
......
......@@ -170,3 +170,8 @@ bool KisShapeLayer::accept(KisLayerVisitor& visitor)
{
return visitor.visit(this);
}
KoShapeManager *KisShapeLayer::shapeManager() const
{
return m_d->canvas->shapeManager();
}
......@@ -87,6 +87,8 @@ public:
QRect exactBounds() const;
bool accept(KisLayerVisitor&);
KoShapeManager *shapeManager() const;
private:
......
......@@ -120,7 +120,7 @@ void KisShapeLayerCanvas::repaint() {
KoToolProxy * KisShapeLayerCanvas::toolProxy()
{
Q_ASSERT(false); // This should never be called as this canvas should have no tools.
// Q_ASSERT(false); // This should never be called as this canvas should have no tools.
return 0;
}
......
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