Closed yaeji98 closed 1 year ago
Current z layer is not expected to be updated when moving an object to foreground. In your code:
if (!readonly) {
objectState.zOrder = maxZLayer + 1;
switchZLayer(maxZLayer);
this.commit();
}
switchZLayer(maxZLayer) do not do anything because new max layer was just set to maxZLayer + 1.
Current z layer is not expected to be updated when moving an object to foreground. In your code:
if (!readonly) { objectState.zOrder = maxZLayer + 1; switchZLayer(maxZLayer); this.commit(); }
switchZLayer(maxZLayer) do not do anything because new max layer was just set to maxZLayer + 1.
@bsekachev , Thank you for your answer!!!!
private toForeground = (): void => {
const { objectState, readonly, maxZLayer,switchZLayer } = this.props;
if (!readonly) {
objectState.zOrder = maxZLayer + 1;
switchZLayer(objectState.zOrder);
this.commit();
}
};
but Changing to the above code does not work. Is there another problem?
Dispatching switchZLayer action must be performed after updating global state with new annotations objects. Since updating the global state is async, there are two ways to do it:
setTimeout(() => switchZLayer(objectState.zOrder))
switchZLayer
in componentDidUpdate
somehow. Additionally, if you are using shortucts, they are handled by other code (not good, I know).
In this file: cvat-ui/src/containers/annotation-page/standard-workspace/objects-side-bar/objects-list.tsx
@bsekachev , Thank you for your answer!!!! The problem has been resolved. Thank you for your quick reply.
My actions before raising this issue
Steps to Reproduce (for bugs)
Expected Behaviour
Current Behaviour
but after click on "To foreground" , currentZLayer not change
I tried to fix it, not working.. \cvat-ui\src\containers\annotation-page\standard-workspace\objects-side-bar\object-item.tsx
full code
Possible Solution
Context
Your Environment
git log -1
):docker version
(e.g. Docker 17.0.05):Logs from `cvat` container