Commit 30d932fa authored by Halla Rempt's avatar Halla Rempt
Browse files

Theoretically, tools can now get at the current image through

the shape manager.

svn path=/trunk/koffice/; revision=602790
parent 9d88941b
......@@ -21,7 +21,8 @@
#include <QWidget>
#include <KoUnit.h>
#include "KoViewConverter.h"
#include <KoViewConverter.h>
#include <KoShapeManager.h>
#include <kis_image.h>
......@@ -35,22 +36,29 @@ class KisCanvas2::KisCanvas2Private {
public:
KisCanvas2Private( KoViewConverter * viewConverter, KisView2 * view )
KisCanvas2Private( KoCanvasBase * parent, KoViewConverter * viewConverter, KisView2 * view )
: viewConverter( viewConverter )
, view( view )
, canvasWidget( 0 )
, shapeManager( new KoShapeManager(parent) )
{
}
~KisCanvas2Private()
{
delete shapeManager;
}
KoViewConverter * viewConverter;
KisView2 * view;
KisAbstractCanvasWidget * canvasWidget;
KoShapeManager * shapeManager;
};
KisCanvas2::KisCanvas2(KoViewConverter * viewConverter, KisCanvasType canvasType, KisView2 * view)
: KoCanvasBase()
{
m_d = new KisCanvas2Private(viewConverter, view);
m_d = new KisCanvas2Private(this, viewConverter, view);
switch( canvasType ) {
......
......@@ -38,9 +38,12 @@
#include <KoZoomAction.h>
#include <KoZoomHandler.h>
#include <KoToolRegistry.h>
#include <KoShapeManager.h>
#include <KoShape.h>
#include <kis_image.h>
#include "kis_dummy_shape.h"
#include "kis_resource_provider.h"
#include "kis_factory2.h"
#include "kis_canvas2.h"
......@@ -160,6 +163,8 @@ void KisView2::slotInitializeCanvas()
kDebug() << "Image completely loaded! W: "
<< image()->width() << ", H: "
<< image()->height() << endl;
m_d->canvas->shapeManager()->add( m_d->doc->imageShape() );
m_d->canvas->setCanvasSize( image()->width(), image()->height() );
m_d->filterManager->updateGUI();
}
......
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