mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 02:59:33 +07:00
[collab/space] IDEA-354681 Collapsed code fragment causes overlapping icons in gutter
Merge-request: IJ-MR-143760 Merged-by: Dmitrii Petukhov <dmitrii.petukhov@jetbrains.com> GitOrigin-RevId: cf1dd675197df4818ac88ce9cd4507de3811e58f
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f34c771a34
commit
a7bce3459a
@@ -112,6 +112,16 @@ private constructor(private val model: CodeReviewEditorGutterControlsModel,
|
||||
// do not paint if there's not enough space
|
||||
if (yShift > 0 && lineData.yRangeWithInlays.last - lineData.yRangeWithInlays.first < yShift + editor.lineHeight) return
|
||||
|
||||
val hasCommentsInFoldedRegion = lineData.foldedRegion?.let { fRegion ->
|
||||
val linesWithComments = state?.linesWithComments ?: return@let false
|
||||
val (frStart, frEnd) = with(editor.document) {
|
||||
getLineNumber(fRegion.startOffset) to getLineNumber(fRegion.endOffset)
|
||||
}
|
||||
|
||||
(frStart..frEnd).any { line -> line in linesWithComments }
|
||||
} ?: false
|
||||
if (hasCommentsInFoldedRegion) return
|
||||
|
||||
val rawIcon = if (lineData.columnHovered) AllIcons.General.InlineAddHover else AllIcons.General.InlineAdd
|
||||
val icon = EditorUIUtil.scaleIcon(rawIcon, editor)
|
||||
val y = lineData.yRangeWithInlays.first + yShift + (editor.lineHeight - icon.iconHeight) / 2
|
||||
|
||||
Reference in New Issue
Block a user