mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-23 20:48:43 +00:00
Add stroke to draw tool color bar.
This commit is contained in:
committed by
Alex Hart
parent
9bd6ad36cc
commit
5fa1560a10
@@ -155,6 +155,11 @@ object HSVColorSlider {
|
|||||||
val radii: FloatArray = (1..8).map { 50f }.toFloatArray()
|
val radii: FloatArray = (1..8).map { 50f }.toFloatArray()
|
||||||
val bounds = RectF()
|
val bounds = RectF()
|
||||||
val clipPath = Path()
|
val clipPath = Path()
|
||||||
|
val paint = Paint().apply {
|
||||||
|
color = Color.WHITE
|
||||||
|
style = Paint.Style.STROKE
|
||||||
|
strokeWidth = ViewUtil.dpToPx(4).toFloat()
|
||||||
|
}
|
||||||
|
|
||||||
return customizeOnDraw { wrapped, canvas ->
|
return customizeOnDraw { wrapped, canvas ->
|
||||||
canvas.save()
|
canvas.save()
|
||||||
@@ -164,6 +169,7 @@ object HSVColorSlider {
|
|||||||
clipPath.rewind()
|
clipPath.rewind()
|
||||||
clipPath.addRoundRect(bounds, radii, Path.Direction.CW)
|
clipPath.addRoundRect(bounds, radii, Path.Direction.CW)
|
||||||
|
|
||||||
|
canvas.drawPath(clipPath, paint)
|
||||||
canvas.clipPath(clipPath)
|
canvas.clipPath(clipPath)
|
||||||
wrapped.draw(canvas)
|
wrapped.draw(canvas)
|
||||||
canvas.restore()
|
canvas.restore()
|
||||||
|
|||||||
@@ -198,7 +198,7 @@
|
|||||||
android:id="@+id/image_editor_hud_draw_color_bar"
|
android:id="@+id/image_editor_hud_draw_color_bar"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="32dp"
|
android:layout_marginStart="20dp"
|
||||||
android:splitTrack="false"
|
android:splitTrack="false"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toTopOf="@id/image_editor_hud_top_of_button_bar_spacing"
|
app:layout_constraintBottom_toTopOf="@id/image_editor_hud_top_of_button_bar_spacing"
|
||||||
|
|||||||
Reference in New Issue
Block a user