Commit 8b99868c authored by Dmitry Kazakov's avatar Dmitry Kazakov
Browse files

Revert "Do not resync decorations wrapper layer when snap-to-guide/grid changes"

This reverts commit c61e01de.

CCBUG:439549
parent 5e36f8eb
......@@ -2035,15 +2035,8 @@ KisGridConfig KisDocument::gridConfig() const
void KisDocument::setGridConfig(const KisGridConfig &config)
{
if (d->gridConfig != config) {
const bool shouldSyncDecorations =
!d->gridConfig.isSameIgnoringSnapping(config);
d->gridConfig = config;
if (shouldSyncDecorations) {
d->syncDecorationsWrapperLayerState();
}
d->syncDecorationsWrapperLayerState();
emit sigGridConfigChanged(config);
}
}
......@@ -2130,15 +2123,8 @@ void KisDocument::setGuidesConfig(const KisGuidesConfig &data)
{
if (d->guidesConfig == data) return;
const bool shouldSyncDecorations =
!d->guidesConfig.isSameIgnoringSnapping(data);
d->guidesConfig = data;
if (shouldSyncDecorations) {
d->syncDecorationsWrapperLayerState();
}
d->syncDecorationsWrapperLayerState();
emit sigGuidesConfigChanged(d->guidesConfig);
}
......
......@@ -55,14 +55,6 @@ void KisGridConfig::transform(const QTransform &transform)
m_offset = KisAlgebra2D::wrapValue(transform.map(m_offset), m_spacing);
}
bool KisGridConfig::isSameIgnoringSnapping(const KisGridConfig &rhs) const
{
KisGridConfig tmp(rhs);
tmp.setSnapToGrid(snapToGrid());
return *this == tmp;
}
void KisGridConfig::loadStaticData()
{
KisConfig cfg(true);
......
......@@ -205,8 +205,6 @@ public:
/// Used with image-wide transformations.
void transform(const QTransform &transform);
bool isSameIgnoringSnapping(const KisGridConfig &rhs) const;
private:
static Qt::PenStyle toPenStyle(LineTypeInternal type) {
return type == LINE_SOLID ? Qt::SolidLine :
......
......@@ -343,11 +343,3 @@ void KisGuidesConfig::transform(const QTransform &transform)
d->horzGuideLines = newHorzGuideLines;
d->vertGuideLines = newVertGuideLines;
}
bool KisGuidesConfig::isSameIgnoringSnapping(const KisGuidesConfig &rhs) const
{
KisGuidesConfig tmp(rhs);
tmp.setSnapToGuides(snapToGuides());
return *this == tmp;
}
......@@ -113,8 +113,6 @@ public:
/// Used with image-wide transformations.
void transform(const QTransform &transform);
bool isSameIgnoringSnapping(const KisGuidesConfig &rhs) const;
private:
class Private;
const QScopedPointer<Private> d;
......
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