Add a few reference images make a bunch of compositions from a whole bunch of layers cycle between the compositions by doubleclicking them eventually the reference images will disappear till you restart the file
I can reproduce this issue. 1. Create a new composition if there is none. 2. Add a reference image if there is none. 3. activate the composition (double click) 4. pan canvas. RESULT: Reference images dissapear. Krita 4.2.9
*** Bug 423167 has been marked as a duplicate of this bug. ***
Git commit ce8879455c7ce7eb02823e367d9da625fb240c2a by Wolthera van Hövell tot Westerflier. Committed on 07/08/2020 at 16:25. Pushed by woltherav into branch 'master'. Fix skipping over fake nodes for composition visibility. The compositions should not be handling anything related to fake nodes, such as the ones where the reference layer and the assistants/guides live one. Related: bug 417911 M +5 -0 libs/image/kis_layer_composition.cpp https://invent.kde.org/graphics/krita/commit/ce8879455c7ce7eb02823e367d9da625fb240c2a
Git commit 0a0caa8594d2429ab36cc6fb8356fa8bd80d4362 by Wolthera van Hövell tot Westerflier. Committed on 07/08/2020 at 16:26. Pushed by woltherav into branch 'krita/4.3'. Fix skipping over fake nodes for composition visibility. The compositions should not be handling anything related to fake nodes, such as the ones where the reference layer and the assistants/guides live one. Related: bug 417911 M +5 -0 libs/image/kis_layer_composition.cpp https://invent.kde.org/graphics/krita/commit/0a0caa8594d2429ab36cc6fb8356fa8bd80d4362
Ok, so there's still the snapshots issue. This one is kinda hairy as it's all weak reference pointer copy implementation magic. But generally, what is happening is that the reference layer gets copied, but the canvas decorations aren't updated (specifically, KisReferenceImagesDecoration::setReferenceImageLayer(KisSharedPtr<KisReferenceImagesLayer> layer) needs to be called for the changing snapshot), and I am not sure where to do that...
(In reply to wolthera from comment #5) > Ok, so there's still the snapshots issue. > > This one is kinda hairy as it's all weak reference pointer copy > implementation magic. > > But generally, what is happening is that the reference layer gets copied, > but the canvas decorations aren't updated (specifically, > KisReferenceImagesDecoration:: > setReferenceImageLayer(KisSharedPtr<KisReferenceImagesLayer> layer) needs to > be called for the changing snapshot), and I am not sure where to do that... Looks like I am able to fix the bug that the reference images are not shown, but the ref images cannot automatically update after a switch. This is probably due to tiar's fix of https://invent.kde.org/graphics/krita/-/commit/311d804aa23f1993ec19513cdd90ad0758627f3c because: [1] d->layer->extent() is always QRectF() # I think this is problematic. [2] slotReferenceImagesChanged() (i.e. the update canvas part) will not be run if extent is empty # tiar thinks extent == QRectF() implies the layer is not loaded yet. But this is not the case. [3] As a result, slotReferenceImagesChanged() will never run.
The crash fixed by tiar is actually due to [1] slotReferenceImagesLayerChanged() called when initializing KisView::Private::referenceImagesDecoration(). [2] At that time, KisView's d-pointer is not yet initialized (Private ctor has not yet return) (so there is a random value). [3] KisView::viewConverter() makes use of its d-pointer. So, it does not seem to be related to the extent being zero.
Git commit 29e666f94178daef0ba5551507d2e388faf45cf2 by Tusooa Zhu. Committed on 08/08/2020 at 19:08. Pushed by tusooaw into branch 'master'. Fix ref images layer not shown after switching snapshot [1] The fix for a crash when loading a file with ref images in https://invent.kde.org/graphics/krita/-/commit/311d804aa23f1993ec19513cdd90ad0758627f3c used layer->extent() as a criterion for judging whether "the layer is loaded." However, this criterion is not correct because the real cause of the crash is KisView's d-pointer is not yet initialized, when KisReferenceImagesDecoration is being constructed, which is called by the ctor of KisView::Private. [2] layer->extent() is always empty so the current situation is KisReferenceImagesDecoration::setReferenceImageLayer() is never called, due to the criterion in [1]. [3] This fix added an argument, viewReady, to the constructor of KisReferenceImagesDecoration, so that when it is being called from KisView::Private's constructor, it will not try to update the canvas because that leads to problems. [4] In setReferenceImageLayer, I also modified the logic to not try to dereference a weak pointer before verifying its validity. If I do not do so, it will trigger an assert. M +4 -2 libs/ui/KisDocument.cpp M +11 -7 libs/ui/KisReferenceImagesDecoration.cpp M +2 -2 libs/ui/KisReferenceImagesDecoration.h M +1 -1 libs/ui/KisView.cpp https://invent.kde.org/graphics/krita/commit/29e666f94178daef0ba5551507d2e388faf45cf2