Skip to content
  • Dmitry Kazakov's avatar
    Fixed a tool activation when the current layer is not enabled · cf2d7731
    Dmitry Kazakov authored
    Way to reproduce:
    1) Open new document
    2) Disable a layer with a mouse
    3) Enable a layer with a tablet
    You will not be able to paint with the tablet.
    
    What actually happened was that a new CanvasData was created, but
    the previous tool could not be activated in the new data, because of
    an explicit check in switchTool. So that we ended up in a state with
    no tool at all.
    
    This patch brings a bit more consistency there. Now you can always
    switch the tool in the KoToolManager, even when active layer is
    disabled, but the KoToolProxy will get information about the new tool
    only when the layer gets enabled back. This is what the code in
    currentLayerChanged() and toolCanBeUsed() has been doing before. There was
    inconsistency in postSwitchTool(), because it didn't check for the
    availability of the active layer, now it is gone.
    
    BUG:277047
    cf2d7731