[calligra] krita/ui: don't even try to merge if there's nothing to merge
Dmitry Kazakov
dimula73 at gmail.com
Sat Feb 25 08:19:21 UTC 2012
Probably, we should be more accurate and not to check
!layer->prevSibling(), but introduce functions like prevLayer(). Because
this check doesn't cover the case when masks and layers are mixed.
On Sat, Feb 25, 2012 at 11:14 AM, Boudewijn Rempt <boud at valdyas.org> wrote:
> Git commit a75a0d1fdbbf9d10657a2577d14b5e80b81ccd3b by Boudewijn Rempt.
> Committed on 25/02/2012 at 09:14.
> Pushed by rempt into branch 'master'.
>
> don't even try to merge if there's nothing to merge
>
> M +3 -2 krita/ui/kis_layer_manager.cc
>
> http://commits.kde.org/calligra/a75a0d1fdbbf9d10657a2577d14b5e80b81ccd3b
>
> diff --git a/krita/ui/kis_layer_manager.cc b/krita/ui/kis_layer_manager.cc
> index 81d27fb..8d2dbaf 100644
> --- a/krita/ui/kis_layer_manager.cc
> +++ b/krita/ui/kis_layer_manager.cc
> @@ -724,9 +724,10 @@ void KisLayerManager::mergeLayer()
> KisLayerSP layer = activeLayer();
> if (!layer) return;
>
> + if (!layer->prevSibling()) return;
> +
> if (layer->metaData()->isEmpty() && layer->prevSibling() &&
> dynamic_cast<KisLayer*>(layer->prevSibling().data())->metaData()->isEmpty())
> {
> - const KisMetaData::MergeStrategy* strategy =
> KisMetaData::MergeStrategyRegistry::instance()->get("Drop");
> - image->mergeDown(layer, strategy);
> + image->mergeDown(layer,
> KisMetaData::MergeStrategyRegistry::instance()->get("Drop"));
> }
> else {
> const KisMetaData::MergeStrategy* strategy =
> KisMetaDataMergeStrategyChooserWidget::showDialog(m_view);
>
--
Dmitry Kazakov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kimageshop/attachments/20120225/4c2d5cbd/attachment.html>
More information about the kimageshop
mailing list