Add stroke to draw tool color bar.

This commit is contained in:
Nicholas Tinsley
2024-03-05 12:50:28 -05:00
committed by Alex Hart
parent 9bd6ad36cc
commit 5fa1560a10
2 changed files with 7 additions and 1 deletions

View File

@@ -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()

View File

@@ -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"