Commit a943b8c7 authored by Mathias Wein's avatar Mathias Wein Committed by Agata Cacko
Browse files

Revert "Make sure that thumbnails are generated from exactBounds()"

This reverts commit 9b7318c1.
(Note: commit 9b7318c1 is the commit from master.
On krita/5.1, it reverts commit f6389225, which has an incorrect
commit message but is the same commit as the one mentioned).

BUG:459510
CCBUG:461436

(cherry picked from commit eda2d6fb)
parent 86912d85
Pipeline #261412 passed with stage
in 45 minutes
......@@ -1828,7 +1828,7 @@ QImage KisPaintDevice::createThumbnail(qint32 maxw, qint32 maxh,
qreal oversample, KoColorConversionTransformation::Intent renderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags)
{
const QRect deviceExtent = exactBounds();
const QRect deviceExtent = extent();
const QSize thumbnailSize = deviceExtent.size().scaled(maxw, maxh, aspectRatioMode);
return createThumbnail(thumbnailSize.width(), thumbnailSize.height(),
oversample, renderingIntent, conversionFlags);
......
......@@ -159,7 +159,7 @@ LayerBox::LayerBox()
: QDockWidget(i18n("Layers"))
, m_canvas(0)
, m_wdgLayerBox(new Ui_WdgLayerBox)
, m_thumbnailCompressor(200, KisSignalCompressor::FIRST_INACTIVE)
, m_thumbnailCompressor(500, KisSignalCompressor::FIRST_INACTIVE)
, m_colorLabelCompressor(500, KisSignalCompressor::FIRST_INACTIVE)
, m_thumbnailSizeCompressor(100, KisSignalCompressor::FIRST_INACTIVE)
, m_treeIndentationCompressor(100, KisSignalCompressor::FIRST_INACTIVE)
......@@ -305,8 +305,7 @@ LayerBox::LayerBox()
setEnabled(false);
connect(&m_idleWatcher, SIGNAL(startedIdleMode()), SLOT(updateDirtyThumbnails()));
connect(&m_thumbnailCompressor, SIGNAL(timeout()), SLOT(notifyThumbnailDirty()));
connect(&m_thumbnailCompressor, SIGNAL(timeout()), SLOT(updateThumbnail()));
connect(&m_colorLabelCompressor, SIGNAL(timeout()), SLOT(updateAvailableLabels()));
......@@ -483,7 +482,6 @@ void LayerBox::setCanvas(KoCanvasBase *canvas)
disconnect(m_nodeManager, 0, this, 0);
disconnect(m_nodeModel, 0, m_nodeManager, 0);
m_nodeManager->slotSetSelectedNodes(KisNodeList());
m_idleWatcher.setTrackedImages({});
}
m_canvas = dynamic_cast<KisCanvas2*>(canvas);
......@@ -492,7 +490,6 @@ void LayerBox::setCanvas(KoCanvasBase *canvas)
m_image = m_canvas->image();
emit imageChanged();
connect(m_image, SIGNAL(sigImageUpdated(QRect)), &m_thumbnailCompressor, SLOT(start()));
m_idleWatcher.setTrackedImage(m_image);
KisDocument* doc = static_cast<KisDocument*>(m_canvas->imageView()->document());
KisShapeController *kritaShapeController =
......@@ -1040,17 +1037,9 @@ void LayerBox::slotNodeManagerChangedSelection(const KisNodeList &nodes)
model->select(selection, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows);
}
void LayerBox::notifyThumbnailDirty()
void LayerBox::updateThumbnail()
{
m_dirtyThumbnailNodes.insert(m_wdgLayerBox->listLayers->currentIndex());
}
void LayerBox::updateDirtyThumbnails()
{
Q_FOREACH (const QModelIndex &index, m_dirtyThumbnailNodes) {
m_wdgLayerBox->listLayers->updateNode(index);
}
m_dirtyThumbnailNodes.clear();
m_wdgLayerBox->listLayers->updateNode(m_wdgLayerBox->listLayers->currentIndex());
}
void LayerBox::slotRenameCurrentNode()
......
......@@ -31,7 +31,6 @@
#include "kis_layer_filter_widget.h"
#include "kis_signal_auto_connection.h"
#include <QSlider>
#include <kis_idle_watcher.h>
class QModelIndex;
......@@ -121,6 +120,7 @@ private Q_SLOTS:
void slotLayerOpMenuOpened();
void slotLayerOpMenuClosed();
void updateThumbnail();
void updateAvailableLabels();
void updateLayerFiltering();
......@@ -129,8 +129,6 @@ private Q_SLOTS:
void slotImageTimeChanged(int time);
void slotForgetAboutSavedNodeBeforeEditSelectionMode();
void notifyThumbnailDirty();
void updateDirtyThumbnails();
Q_SIGNALS:
void imageChanged();
......@@ -177,8 +175,6 @@ private:
KisNodeWSP m_savedNodeBeforeEditSelectionMode;
bool m_blockOpacityUpdate {false};
KisSignalAutoConnectionsStore m_activeNodeConnections;
QSet<QModelIndex> m_dirtyThumbnailNodes;
KisIdleWatcher m_idleWatcher;
};
class LayerBoxFactory : public KoDockFactoryBase
......
Supports Markdown
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