Commit 2f5bdbd4 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Moving the actual image resize code back into the core works -- but why?

svn path=/trunk/koffice/; revision=316445
parent 21ff2487
......@@ -228,6 +228,20 @@ DCOPObject* KisView::dcopObject()
return m_dcop;
}
void KisView::resize(Q_INT32 w, Q_INT32 h)
{
KisImageSP img = currentImg();
if (img) {
img -> resize(w, h);
img -> invalidate();
resizeEvent(0);
layersUpdated();
canvasRefresh();
}
}
void KisView::setupDockers()
{
......
......@@ -90,6 +90,8 @@ public:
virtual void updateReadWrite(bool readwrite);
virtual void guiActivateEvent(KParts::GUIActivateEvent *event);
virtual void resize(Q_INT32 w, Q_INT32 h);
public:
Q_INT32 docWidth() const;
Q_INT32 docHeight() const;
......
......@@ -101,6 +101,7 @@ void ImageSize::slotActivated()
Q_INT32 h = dlgImageSize -> height();
if (dlgImageSize -> scale()) {
imageScale(w, h);
}
else {
imageResize(w, h);
......@@ -112,15 +113,29 @@ void ImageSize::slotActivated()
void ImageSize::imageResize(Q_INT32 w, Q_INT32 h)
{
kdDebug() << "Resizing to: Width: " << w << ", Height: " << h << "\n";
if (m_view) {
#if 1
m_view -> resize(w, h);
#else
// XXX: this doesn't work -- but why?
KisImageSP image = m_view -> currentImg();
if (image) {
kdDebug() << "Resizing to: Width: " << w << ", Height: " << h << "\n";
image -> resize(w, h);
image -> invalidate();
m_view -> refresh();
}
#endif
}
}
void ImageSize::imageScale(Q_INT32 w, Q_INT32 h)
{
if (m_view) {
// XXX
}
}
......
......@@ -40,7 +40,8 @@ private slots:
private:
void imageResize(Q_INT32 w, Q_INT32 h);
void imageScale(Q_INT32 w, Q_INT32 h);
KisView * m_view;
KisPainter * m_painter;
......
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