Bug 137638 - Strange Behaviour wih Select All and adjustement layer
Summary: Strange Behaviour wih Select All and adjustement layer
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Filter Layers (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Halla Rempt
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-20 21:12 UTC by Vsevolod Krishchenko
Modified: 2006-12-30 16:28 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Sample with adj. layer (12.23 KB, application/x-krita)
2006-11-20 21:14 UTC, Vsevolod Krishchenko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vsevolod Krishchenko 2006-11-20 21:12:19 UTC
Version:           1.6.1 (using KDE 3.5.5, Kubuntu (edgy) 4:3.5.5-0ubuntu3)
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.17-10-386

I complied Krita from SVN and found thsi strange bug.
1. Load file attached
2. Click on Adj. Layer (Br/Cntr). Select All (or Ctrl+A)
3. CLick on Image Layer 1. Select ALl (or Ctrl+A) again

After this, adj. layer does not affect image but it is still white!

If I saved this modified file and load it again, adj. layer showed as totally dark (transparent). But I don't think that it is normal behaviour for Select All comand anyway...
Comment 1 Vsevolod Krishchenko 2006-11-20 21:14:13 UTC
Created attachment 18630 [details]
Sample with adj. layer
Comment 2 Halla Rempt 2006-11-20 21:27:24 UTC
I can confirm this with Krita 1.6.1 :-(. Thanks for the bug report!
Comment 3 Bart Coppens 2006-12-30 16:28:04 UTC
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();