Fixed
Status Update
Comments
ma...@google.com <ma...@google.com> #2
Thanks John. In other words, per chat discussions, we need a Modifier.background
overload that accepts Painter and paints it as a background, properly calling drawContent
. Over to Nader to take a look.
an...@google.com <an...@google.com>
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit 58b99f068004fee3861dfcce7b09d33c5fe4a891
Author: Nader Jawad <njawad@google.com>
Date: Fri Jul 16 15:36:08 2021
Make Modifier.paint behave like Modifier.drawBehind
Relnote: "In order to better support chaining of
draw modifiers, make sure the Modifier.paint implementation
calls drawsContent.
Previously Modifier.paint was expected to a leaf node in
the chain of Modifiers, however, by doing so it prevents
it from being configured on a composable container (ex. box)
or adding additional decorations on top such as
Modifier.paint().border(). By having Modifier.paint
call drawContent after drawing the contents of the given
painter, we have better behavior consistency in behavior
with the modifier pattern."
Fixes: 178201337
Fixes: 186213275
Test: Added test to PainterModifierTest
Change-Id: Ibb2a7ae54a86643ba4fc1604ce39df7477ab66f0
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/draw/PainterModifierTest.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/draw/PainterModifier.kt
https://android-review.googlesource.com/1770022
Branch: androidx-main
commit 58b99f068004fee3861dfcce7b09d33c5fe4a891
Author: Nader Jawad <njawad@google.com>
Date: Fri Jul 16 15:36:08 2021
Make Modifier.paint behave like Modifier.drawBehind
Relnote: "In order to better support chaining of
draw modifiers, make sure the Modifier.paint implementation
calls drawsContent.
Previously Modifier.paint was expected to a leaf node in
the chain of Modifiers, however, by doing so it prevents
it from being configured on a composable container (ex. box)
or adding additional decorations on top such as
Modifier.paint().border(). By having Modifier.paint
call drawContent after drawing the contents of the given
painter, we have better behavior consistency in behavior
with the modifier pattern."
Fixes: 178201337
Fixes: 186213275
Test: Added test to PainterModifierTest
Change-Id: Ibb2a7ae54a86643ba4fc1604ce39df7477ab66f0
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/draw/PainterModifierTest.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/draw/PainterModifier.kt
Description
Jetpack Compose release version: 1.0.0-alpha10
Android Studio 4.2 Beta 1 Build #AI-202.7660.26.42.6987402, built on November 21, 2020 Runtime version: 11.0.8+0-b944-P17168821 amd64 VM: OpenJDK 64-Bit Server VM by N/A Linux 5.7.17-1rodete5-amd64 GC: G1 Young Generation, G1 Old Generation Memory: 5120M Cores: 72 Registry: external.system.auto.import.disabled=true, ide.index.image.max.size=0, caches.indexerThreadsCount=24 Non-Bundled Plugins: com.intellij.marketplace, com.thoughtworks.gauge, org.jetbrains.kotlin, org.intellij.plugins.markdown Current Desktop: X-Cinnamon
Modifier.paint() does not call drawContent().
Steps to Reproduce: