Skip to content

Commit

Permalink
Revert "Remove revalidate"
Browse files Browse the repository at this point in the history
This reverts commit b036927.
  • Loading branch information
igordmn committed Sep 17, 2024
1 parent b036927 commit f54ed82
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions skiko/src/awtMain/kotlin/org/jetbrains/skiko/SkiaLayer.awt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,13 @@ actual open class SkiaLayer internal constructor(
@Suppress("LeakingThis")
add(backedLayer)

addHierarchyBoundsListener(object : HierarchyBoundsAdapter() {
override fun ancestorMoved(e: HierarchyEvent?) {
redrawer?.syncBounds()
addAncestorListener(object : AncestorListener {
override fun ancestorAdded(event: AncestorEvent?) = Unit

override fun ancestorRemoved(event: AncestorEvent?) = Unit

override fun ancestorMoved(event: AncestorEvent?) {
revalidate()
}
})

Expand All @@ -153,7 +157,7 @@ actual open class SkiaLayer internal constructor(
addPropertyChangeListener("graphicsContextScaleTransform") {
Logger.debug { "graphicsContextScaleTransform changed for $this" }
latestReceivedGraphicsContextScaleTransform = it.newValue as AffineTransform
redrawer?.syncBounds()
revalidate()
notifyChange(PropertyKind.ContentScale)

// Workaround for JBR-5259
Expand Down

0 comments on commit f54ed82

Please sign in to comment.