| Summary: | Should be the way to paint on adjustment laeyrs | ||
|---|---|---|---|
| Product: | [Applications] krita | Reporter: | Vsevolod Krishchenko <mstu> |
| Component: | Filter Layers | Assignee: | Krita Bugs <krita-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | unspecified | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Vsevolod Krishchenko
2006-11-21 23:29:39 UTC
This already works, but not in the same way as with the layer masks: with masks you draw in a tint of gray to vary transparency, with adjustment layers you must set the opacity in the tool option docker to draw with less than 100% opaque. And this only works when there's a selection active on the adjustment layer... What a mess: I'm upgrading this wishlist item to a bug because it's a feature that's already implemented, it's just not working correctly. SVN commit 617779 by coppens:
When deselecting the adjustment layer, don't do weird stuff, but something reasonable. (But should it make everything adjusted, or nothing at all? Currently it does the 'everything adjusted' thing...)
CCBUG:137708
M +11 -0 core/kis_adjustment_layer.cc
M +3 -0 core/kis_adjustment_layer.h
M +3 -2 ui/kis_selection_manager.cc
--- branches/koffice/1.6/koffice/krita/core/kis_adjustment_layer.cc #617778:617779
@@ -118,7 +118,18 @@
m_selection->setSelection(m_selection);
}
+void KisAdjustmentLayer::clearSelection()
+{
+ KisFillPainter gc(m_selection.data());
+ KisColorSpace * cs = KisMetaRegistry::instance()->csRegistry()->getRGB8();
+ QRect bounds = extent();
+ bounds |= image()->bounds();
+ gc.fillRect(bounds, KisColor(Qt::white, cs), MAX_SELECTED);
+ gc.end();
+}
+
+
Q_INT32 KisAdjustmentLayer::x() const
{
if (m_selection)
--- branches/koffice/1.6/koffice/krita/core/kis_adjustment_layer.h #617778:617779
@@ -61,6 +61,9 @@
/// Set the selction of this adjustment layer to a copy of selection.
void setSelection(KisSelectionSP selection);
+ /// Clears the selection (doesn't call any of the update or dirty methods)
+ void clearSelection();
+
virtual void paintSelection(QImage &img, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h);
virtual void paintSelection(QImage &img, const QRect& scaledImageRect, const QSize& scaledImageSize, const QSize& imageSize);
public:
--- branches/koffice/1.6/koffice/krita/ui/kis_selection_manager.cc #617778:617779
@@ -529,8 +529,9 @@
Q_CHECK_PTR(t);
// Make adjustment layers behave almost the same (except no reselect)
- if (dynamic_cast<KisAdjustmentLayer*>(img->activeLayer().data())) {
- dev->clear();
+ KisAdjustmentLayer* adj = dynamic_cast<KisAdjustmentLayer*>(img->activeLayer().data());
+ if (adj) {
+ adj->clearSelection();
} else {
dev->deselect();
}
SVN commit 617918 by coppens:
Strange that this didn't work, but the new way is more consistent and actually works. Also changed the previously mentioned clearSelection on the adjustment layers to something sensible: Select All -> apply adjustment everywhere, Deselect -> apply nowhere.
BUG:137638
CCBUG:137708
M +1 -1 core/kis_adjustment_layer.cc
M +9 -2 ui/kis_selection_manager.cc
--- branches/koffice/1.6/koffice/krita/core/kis_adjustment_layer.cc #617917:617918
@@ -125,7 +125,7 @@
QRect bounds = extent();
bounds |= image()->bounds();
- gc.fillRect(bounds, KisColor(Qt::white, cs), MAX_SELECTED);
+ gc.fillRect(bounds, KisColor(Qt::white, cs), MIN_SELECTED);
gc.end();
}
--- branches/koffice/1.6/koffice/krita/ui/kis_selection_manager.cc #617917:617918
@@ -508,8 +508,15 @@
if (img->undo()) t = new KisSelectedTransaction(i18n("Select All"), dev);
Q_CHECK_PTR(t);
- dev->selection()->clear();
- dev->selection()->invert();
+ // Make adjustment layers behave better
+ KisAdjustmentLayer* adj = dynamic_cast<KisAdjustmentLayer*>(img->activeLayer().data());
+ if (adj) {
+ adj->clearSelection();
+ adj->selection()->invert();
+ } else {
+ dev->selection()->clear();
+ dev->selection()->invert();
+ }
dev->setDirty();
dev->emitSelectionChanged();
Fixed for 1.6, replaced with different code for trunk. |