Skip to content

Drawing shapes with Path #1066

Answered by Bayramito
Bayramito asked this question in Q&A
Nov 9, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

I actually achieved something with this:

 // PATH
  const path = Skia.Path.Make();
  path.moveTo(0, tl);
  // add rounded corner
  if (tl > 0) {
    path.rArcTo(tl, tl, 0, true, false, tl, -tl);
  }
  path.lineTo(WIDTH - tr, 0);
  // // add rounded corner
  if (tr > 0) {
    path.rArcTo(tr, tr, 0, true, false, tr, tr);
  }
  path.lineTo(WIDTH, HEIGHT - br);
  // //add rounded corner
  if (br > 0) {
    path.rArcTo(br, br, 0, true, false, -br, br);
  }
  path.lineTo(bl, HEIGHT);
  // //add rounded corner
  if (bl > 0) {
    path.rArcTo(bl, bl, 0, true, false, -bl, -bl);
  }
  path.close();
  const tl = childrenStyles?.borderRadius || childrenStyles?.borderTopLeftRadius || 0;
  const tr = …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Bayramito
Comment options

Answer selected by Bayramito
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant