Fix: 댓글 레이어 맨 앞으로

This commit is contained in:
정현조 2024-09-29 22:11:22 +09:00
parent ec54881187
commit 66f2aea4ec

View File

@ -359,30 +359,7 @@ export default function ImageCanvas() {
<Layer> <Layer>
<Image image={image} /> <Image image={image} />
</Layer> </Layer>
<Layer>
{comments.map((comment) => (
<CommentLabel
key={comment.id}
comment={comment}
updateComment={(updatedComment) => {
updateCommentMutation.mutate({
commentId: comment.id,
commentData: {
content: updatedComment.content,
positionX: updatedComment.positionX,
positionY: updatedComment.positionY,
},
});
}}
deleteComment={(commentId) => {
deleteCommentMutation.mutate(commentId);
}}
toggleComment={(commentId) => {
useCommentStore.getState().toggleComment(commentId);
}}
/>
))}
</Layer>
{project?.type !== 'classification' && ( {project?.type !== 'classification' && (
<Layer listening={drawState === 'pointer'}> <Layer listening={drawState === 'pointer'}>
{labels.map((label) => {labels.map((label) =>
@ -455,6 +432,30 @@ export default function ImageCanvas() {
</Layer> </Layer>
)} )}
<Layer>
{comments.map((comment) => (
<CommentLabel
key={comment.id}
comment={comment}
updateComment={(updatedComment) => {
updateCommentMutation.mutate({
commentId: comment.id,
commentData: {
content: updatedComment.content,
positionX: updatedComment.positionX,
positionY: updatedComment.positionY,
},
});
}}
deleteComment={(commentId) => {
deleteCommentMutation.mutate(commentId);
}}
toggleComment={(commentId) => {
useCommentStore.getState().toggleComment(commentId);
}}
/>
))}
</Layer>
<Layer ref={dragLayerRef} /> <Layer ref={dragLayerRef} />
</Stage> </Stage>
<CanvasControlBar <CanvasControlBar