Fixed
Status Update
Comments
an...@google.com <an...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 0b59f61c0857f21b4ce2e8b047045890ea2ba787
Author: Nader Jawad <njawad@google.com>
Date: Fri Jun 25 14:12:02 2021
Updated border rendering for generic shapes
Modified algorithm to render borders for
generic shapes to address issues with
paths defined with fixed dimensions.
Optionally create an offscreen ImageBitmap
used to draw the original path with 2x the
specified stroke width and remove the outer
stroke by creating a rectangular path with
the initial path removed from it and drawn
to the offscreen bitmap with BlendMode.Clear
Updated some bordertest implementations to be
more resilient to density changes
Fixes: 191817116
Fixes: 191672863
Fixes: 184647469
Test: Re-ran + added tests to BorderTest
Change-Id: Ifa69715ceff1a6c0fbaee9fb8c3fef379e9a33c5
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/BorderTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/Border.kt
https://android-review.googlesource.com/1748871
Branch: androidx-main
commit 0b59f61c0857f21b4ce2e8b047045890ea2ba787
Author: Nader Jawad <njawad@google.com>
Date: Fri Jun 25 14:12:02 2021
Updated border rendering for generic shapes
Modified algorithm to render borders for
generic shapes to address issues with
paths defined with fixed dimensions.
Optionally create an offscreen ImageBitmap
used to draw the original path with 2x the
specified stroke width and remove the outer
stroke by creating a rectangular path with
the initial path removed from it and drawn
to the offscreen bitmap with BlendMode.Clear
Updated some bordertest implementations to be
more resilient to density changes
Fixes: 191817116
Fixes: 191672863
Fixes: 184647469
Test: Re-ran + added tests to BorderTest
Change-Id: Ifa69715ceff1a6c0fbaee9fb8c3fef379e9a33c5
M compose/foundation/foundation/src/androidAndroidTest/kotlin/androidx/compose/foundation/BorderTest.kt
M compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/Border.kt
da...@gmail.com <da...@gmail.com> #3
Thank you!
Description
Component used: Box Version used: 1.0.0-beta09 Devices/Android versions reproduced on: Nexus 5X API 29 emulator
When applying a border from a custom shape the result is not well centered.
This is the Path being applied:
fun getSuperellipseShapePath(): Path { return androidx.core.graphics.PathParser.createPathFromPathData( superEllipsePath.trimMargin() ) }
val superEllipsePath = "M3.2775,3.2775 C5.81348,0.74152 11.5,0 23,0 C34.5,0 40.18652,0.74152 42.7225,3.2775 C45.25848, 5.81348 46,11.5 46,23 C46,34.5 45.25848,40.18652 42.7225,42.7225 C40.18652,45.25848 34.5,46 23, 46 C11.5,46 5.81348,45.25848 3.2775,42.7225 C0.74152,40.18652 0,34.5 0,23 C0,11.5 0.74152, 5.81348 3.2775,3.2775 Z"