TP-57318 | configurable peak aspect ratio for tooltip (#525)
This commit is contained in:
@@ -42,7 +42,8 @@ class ToolTipShape(
|
||||
private val peakRadiusDp: Dp = 0.dp,
|
||||
private val bottomPeakRadiusDp: Dp = 0.dp,
|
||||
private val offsetPercentage: Float = 0.0f,
|
||||
private val offset: Dp? = null
|
||||
private val offset: Dp? = null,
|
||||
private val peakAspectRatio: Float = RATIO
|
||||
) : Cloneable, Shape {
|
||||
|
||||
companion object {
|
||||
@@ -80,7 +81,7 @@ class ToolTipShape(
|
||||
peakHeight = with(density) { peakHeightDp.toPx() }
|
||||
defaultCornerRadius = with(density) { defaultCornerRadiusDp.toPx() }
|
||||
if (defaultCornerRadius > maxCornerRadius) defaultCornerRadius = maxCornerRadius
|
||||
peakWidth = peakHeight * RATIO
|
||||
peakWidth = peakHeight * peakAspectRatio
|
||||
peakRadius = with(density) { peakRadiusDp.toPx() }
|
||||
bottomPeakRadius = with(density) { bottomPeakRadiusDp.toPx() }
|
||||
offsetPx = with(density) { offset?.toPx() }
|
||||
|
||||
Reference in New Issue
Block a user