orangy03/21/2021, 5:45 PM
romainguy03/21/2021, 8:01 PM
orangy03/21/2021, 8:16 PM
jim03/22/2021, 7:24 AM
Sergey Y.03/25/2021, 5:49 PM
Nader Jawad03/25/2021, 6:11 PM
Sergey Y.03/25/2021, 6:21 PM
Nader Jawad03/25/2021, 6:25 PM
Sergey Y.03/25/2021, 6:26 PM
orangy03/27/2021, 2:13 PM
Am I doing something wrong here?
Modifier.clip(RoundedCornerShape(8.dp)).border(BorderStroke(2.dp, Color(0xFF623D15)), RoundedCornerShape(8.dp))
I get this, without any issue for the corners.
<svg width="400" height="180"> <rect x="50" y="20" rx="20" ry="20" width="150" height="150" style="fill:red;stroke:black;stroke-width:5;opacity:0.5" /> </svg>
function. First it adjusts stroke width like
with some long explanation text above which is not entirely clear (to me), and then it draws another rounded rect of hairline width (1px always) on top of it. So I made a copy of this function, removed both hacks, and I see that border has now proper width. But then, there is background visible through antialiased pixels of the border at the corners. I believe, that hackery was introduced to fix this, but I think it’s not really proper way, because of the resulting effect.
val strokeWidth = 1.2f * borderSize
or even get rid of the selector altogether and have
a data class with nullable stroke and fill brushes. Skia has this
but it is unused, so I believe it is impossible to make it via compose. I don’t think it is possible to properly emulate this with separate fill and stroke, due to all the antialiasing.
romainguy03/27/2021, 8:35 PM
orangy03/27/2021, 9:31 PM
romainguy03/27/2021, 9:39 PM
orangy03/27/2021, 9:41 PM
romainguy03/27/2021, 9:42 PM
orangy03/27/2021, 9:44 PM
instead of separate background and border and clip modifiers… I can do that for myself, of course 🙂
Nader Jawad03/27/2021, 11:22 PM
orangy03/27/2021, 11:33 PM
version is better than
above), but I’d really appreciate if compose would do the right thing out of the box. I will also think about adjusting radius for half of stroke size, to adapt for outer/inner, but not sure how to do this properly for radius less then half of stroke width – should it become rectangular at this point? Anyway, my solution works for me.
Nader Jawad03/27/2021, 11:38 PM
orangy03/27/2021, 11:39 PM
romainguy03/28/2021, 12:08 AM
orangy03/28/2021, 12:14 AM
romainguy03/28/2021, 12:16 AM
Nader Jawad03/28/2021, 1:43 AM
orangy03/28/2021, 10:55 AM
mzgreen04/15/2021, 8:04 AM
Nader Jawad06/07/2021, 6:32 PM