{"id":306487,"date":"2020-07-06T09:00:32","date_gmt":"2020-07-06T09:00:32","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=306487"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2020-07-06T09:00:32","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=306487","title":{"rendered":"Flutter. \u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f, \u043a\u0430\u043a \u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0444\u0438\u0433\u0443\u0440\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e CustomClipper"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/509384\/\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_f\/0j\/f9\/_f0jf9hlqb9w7q4xyrhcwmfcitk.png\"><\/p>\n<p>  <\/p>\n<p>Flutter \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0432\u0438\u0434\u0436\u0435\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0444\u0438\u0433\u0443\u0440, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/api.flutter.dev\/flutter\/widgets\/ClipRect-class.html\" rel=\"nofollow\">ClipRect<\/a>, <a href=\"https:\/\/api.flutter.dev\/flutter\/widgets\/ClipRRect-class.html\" rel=\"nofollow\">ClipRRect<\/a>, <a href=\"https:\/\/api.flutter.dev\/flutter\/widgets\/ClipOval\/ClipOval.html\" rel=\"nofollow\">ClipOval<\/a>. \u041d\u043e \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c <a href=\"https:\/\/api.flutter.dev\/flutter\/widgets\/ClipPath-class.html\" rel=\"nofollow\">ClipPath<\/a>, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0442\u0438\u043f\u044b \u0444\u0438\u0433\u0443\u0440.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u043c\u0441\u044f \u043d\u0430 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <a href=\"https:\/\/api.flutter.dev\/flutter\/widgets\/ClipPath-class.html\" rel=\"nofollow\">ClipPath<\/a> \u0438 <a href=\"https:\/\/api.flutter.dev\/flutter\/rendering\/CustomClipper-class.html\" rel=\"nofollow\">CustomClipper<\/a>. \u041f\u043e\u0435\u0445\u0430\u043b\u0438!<\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p><strong>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435:<\/strong><\/p>\n<p>  <\/p>\n<ul>\n<li><a href=\"#clippath\">ClipPath<\/a><\/li>\n<li><a href=\"#lineto\">lineTo<\/a><\/li>\n<li><a href=\"#moveto\">moveTo<\/a><\/li>\n<li><a href=\"#quadraticbezierto\">quadraticBezierTo<\/a><\/li>\n<li><a href=\"#cubicto\">cubicTo<\/a><\/li>\n<li><a href=\"#arctopoint\">arcToPoint<\/a><\/li>\n<li><a href=\"#arcto\">arcTo<\/a><\/li>\n<li><a href=\"#addrect\">addRect<\/a><\/li>\n<li><a href=\"#addrrect\">addRRect<\/a><\/li>\n<li><a href=\"#addoval\">addOval<\/a><\/li>\n<li><a href=\"#addpolygon\">addPolygon<\/a><\/li>\n<li><a href=\"#addpath\">addPath<\/a><\/li>\n<li><a href=\"#relativelineto\">relativeLineTo<\/a><\/li>\n<\/ul>\n<p>  <\/p>\n<h2 id=\"clippath\">ClipPath<\/h2>\n<p>  <\/p>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f ClipPath \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0438 \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u044b\u0435 \u0444\u0438\u0433\u0443\u0440\u044b. \u0412 \u044d\u0442\u043e\u043c \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e <strong>clipper<\/strong> \u0443 ClipPath<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">@override Widget build(BuildContext context) {   return Scaffold(     backgroundColor: Colors.grey,     body: Center(       child: ClipPath(         clipper: MyCustomClipper(), \/\/ &lt;--         child: Container(           width: 200,           height: 200,           color: Colors.pink,         ),       ),     ),   ); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u043b\u044f clipper \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u044e\u0442 <code>CustomClipper&lt;Path&gt;<\/code> \u0438 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430.<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">class MyCustomClipper extends CustomClipper&lt;Path&gt; {   @override   Path getClip(Size size) {     Path path = Path();     return path;   }    @override   bool shouldReclip(CustomClipper&lt;Path&gt; oldClipper) =&gt; false }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u0435\u0442\u043e\u0434 <strong><a href=\"https:\/\/api.flutter.dev\/flutter\/rendering\/CustomClipper\/getClip.html\" rel=\"nofollow\">getClip<\/a><\/strong> \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0430\u0448\u0443 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0444\u0438\u0433\u0443\u0440\u0443. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043c\u0435\u0442\u043e\u0434 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 <code>Size<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <strong>\u0432\u044b\u0441\u043e\u0442\u044b<\/strong> \u0438 <strong>\u0448\u0438\u0440\u0438\u043d\u044b<\/strong> \u0432\u0438\u0434\u0436\u0435\u0442\u0430, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0432 <code>\u0441hild<\/code> \u0443 <code>ClipPath<\/code>.<\/p>\n<p>  <\/p>\n<p><strong><a href=\"https:\/\/api.flutter.dev\/flutter\/rendering\/CustomClipper\/shouldReclip.html\" rel=\"nofollow\">shouldReclip<\/a><\/strong> \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u0432 <code>clipper<\/code> \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043a\u043b\u0430\u0441\u0441\u0430. \u0415\u0441\u043b\u0438 \u043d\u043e\u0432\u044b\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0441\u0442\u0430\u0440\u043e\u0433\u043e, \u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c <code>true<\/code>, \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u2013 <code>false<\/code>.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0438\u0433\u0443\u0440\u0443 \u0432\u043d\u0443\u0442\u0440\u0438 <code>CustomClipper<\/code>. \u042d\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u043e, \u043d\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0434\u043e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u043e\u0441\u043d\u043e\u0432\u0430\u043c\u0438 \u0433\u0440\u0430\u0444\u0438\u043a\u0438.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bg\/8c\/qv\/bg8cqvramjg30inpgucayzeveow.png\"><\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u0432\u044b\u0448\u0435 \u0440\u0438\u0441\u0443\u043d\u043a\u0435, \u043a\u0430\u0436\u0434\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0443 (<code>x<\/code>,<code>y<\/code>). <code>x<\/code> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u0443\u044e \u043e\u0441\u044c, \u0430 <code>y<\/code> \u2013 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u043e\u0441\u044c. \u041f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0444\u0438\u0433\u0443\u0440\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u0432\u0435\u0440\u0445\u043d\u0435\u0433\u043e \u043b\u0435\u0432\u043e\u0433\u043e \u0443\u0433\u043b\u0430, \u0447\u044c\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430 (<code>0<\/code>, <code>0<\/code>).<\/p>\n<p>  <\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0444\u0438\u0433\u0443\u0440. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0444\u0438\u0433\u0443\u0440\u044b.<\/p>\n<p>  <\/p>\n<h2 id=\"lineto\">lineTo<\/h2>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043e\u0442\u0440\u0435\u0437\u043a\u0430 \u043e\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0442\u043e\u0447\u043a\u0438 \u0434\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/by\/ds\/ok\/bydsokyfyrmtrh7rxo5sampwqg8.png\"><\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0432\u044b\u0448\u0435 \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 (a), \u043f\u0443\u0442\u044c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u0442\u043e\u0447\u043a\u0438 <code>p1(0, 0)<\/code>. \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u043e\u0442\u0440\u0435\u0437\u043e\u043a \u043a <code>p2(0, h)<\/code>, \u0430 \u0437\u0430\u0442\u0435\u043c \u2013 <code>p3(w, h)<\/code>. \u041d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u043b\u0438\u043d\u0438\u044e \u043e\u0442 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 <code>p3<\/code> \u0434\u043e \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 <code>p1<\/code>, \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e.<\/p>\n<p>  <\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 (b) \u0441 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u043c \u0440\u043e\u0437\u043e\u0432\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430.<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">@override Path getClip(Size size) {    Path path = Path()     ..lineTo(0, size.height) \/\/ \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u0440\u0435\u0437\u043e\u043a p1p2     ..lineTo(size.width, size.height) \/\/ \u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0442\u0440\u0435\u0437\u043e\u043a p2p3     ..close();    return path; }<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"moveto\">moveTo<\/h2>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0442\u043e\u0447\u043a\u0438 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u043a\u0438.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/i0\/ft\/ya\/i0ftyalfqbhmuedirnhbze-hza4.png\"><\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u0432\u044b\u0448\u0435, \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u0430 \u0438\u0437 <code>(0, 0)<\/code> \u0432 \u0442\u043e\u0447\u043a\u0443 <code>p1(w\/2, 0)<\/code>.<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">@override Path getClip(Size size) {    Path path = Path() \/\/ \u041d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u0432 (0, 0)     ..moveTo(size.width\/2, 0) \/\/ \u043f\u0435\u0440\u0435\u0434\u0432\u0438\u0433\u0430\u0435\u043c \u0442\u043e\u0447\u043a\u0443 \u0432 (width\/2, 0)     ..lineTo(0, size.width)     ..lineTo(size.width, size.height)     ..close();    return path; }<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"quadraticbezierto\">quadraticBezierTo<\/h2>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u043e\u0439 \u043a\u0440\u0438\u0432\u043e\u0439 \u0411\u0435\u0437\u044c\u0435.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ed\/4z\/so\/ed4zsoictpbqg-dtsuzm_h1afxm.png\"><br \/>  <em>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a: <a href=\"https:\/\/en.wikipedia.org\/wiki\/B%C3%A9zier_curve#Quadratic_B%C3%A9zier_curves\" rel=\"nofollow\">Wikipedia<\/a><\/em><\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u0432\u044b\u0448\u0435 \u0440\u0438\u0441\u0443\u043d\u043a\u0435, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u0438\u0447\u043d\u0443\u044e \u043a\u0440\u0438\u0432\u0443\u044e \u0411\u0435\u0437\u044c\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u0443\u044e \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u0443\u044e \u0442\u043e\u0447\u043a\u0438. P0 \u2013 \u044d\u0442\u043e \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430, P1 \u2013\u00a0\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430, \u0430 P2 \u2013 \u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/nz\/yp\/8y\/nzyp8y8-2i_snojozdovlbmdw6e.png\"><\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0432\u044b\u0448\u0435 \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 (\u0430), \u043a\u0440\u0438\u0432\u0430\u044f \u0440\u0438\u0441\u0443\u0435\u0442\u0441\u044f \u043e\u0442 \u0442\u043e\u0447\u043a\u0438 <code>p2(0, h)<\/code> \u0434\u043e <code>p3(w, h)<\/code> \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 <code>c(w\/2, h\/2)<\/code>.<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">@override Path getClip(Size size) {   \/\/ \u042d\u0442\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0430 \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f, \u043a\u0430\u043a\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 quadraticBezierTo   var controlPoint = Offset(size.width \/ 2, size.height \/ 2);   var endPoint = Offset(size.width, size.height);    Path path = Path()     ..moveTo(size.width \/ 2, 0)     ..lineTo(0, size.height)     ..quadraticBezierTo(         controlPoint.dx, controlPoint.dy, endPoint.dx, endPoint.dy)     ..close();    return path; }<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"cubicto\">cubicTo<\/h2>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043a\u0443\u0431\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043a\u0440\u0438\u0432\u043e\u0439 \u043f\u0443\u0442\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f 2 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u044b\u0445 \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u0435\u043a.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/dh\/sz\/0d\/dhsz0dptakr3mtwr_9hncza6-5q.png\"><\/p>\n<p>  <\/p>\n<p>\u041d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u0432\u044b\u0448\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043a\u0443\u0431\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043a\u0440\u0438\u0432\u044b\u0445 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/kx\/en\/wu\/kxenwu2exm9tev5pxwagxbb-niy.png\"><\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 (a), \u043a\u0443\u0431\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u0440\u0438\u0432\u0430\u044f \u0440\u0438\u0441\u0443\u0435\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 <code>p2<\/code> \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 <code>p3<\/code> \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a <code>c1<\/code> \u0438 <code>c2<\/code>.<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">@override Path getClip(Size size) {    var controlPoint1 = Offset(50, size.height - 100);   var controlPoint2 = Offset(size.width - 50, size.height);   var endPoint = Offset(size.width, size.height - 50);    Path path = Path()     ..moveTo(size.width \/ 2, 0)     ..lineTo(0, size.height - 50)     ..cubicTo(controlPoint1.dx, controlPoint1.dy, controlPoint2.dx,         controlPoint2.dy, endPoint.dx, endPoint.dy)     ..close();    return path; }<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"arctopoint\">arcToPoint<\/h2>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u0440\u0438\u0441\u043e\u0432\u0430\u043d\u0438\u044f \u0434\u0443\u0433\u0438 \u043e\u0442 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0434\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0434\u0443\u0433\u0443, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 \u0440\u0430\u0434\u0438\u0443\u0441, \u0443\u043a\u0430\u0437\u0430\u0432 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 (\u043f\u043e \u0447\u0430\u0441\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0435\u043b\u043a\u0435 \/ \u043f\u0440\u043e\u0442\u0438\u0432 \u0447\u0430\u0441\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0435\u043b\u043a\u0438).<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xt\/kg\/il\/xtkgilhir9tpfzy5xufoegsliuc.png\"><\/p>\n<p>  <\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u044d\u043b\u043b\u0438\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438 \u043a\u0440\u0443\u0433\u043e\u0432\u043e\u0439 \u0442\u0438\u043f\u044b \u0440\u0430\u0434\u0438\u0443\u0441\u0430 \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0434\u0443\u0433\u0438. \u041a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u0432\u044b\u0448\u0435 \u0440\u0438\u0441\u0443\u043d\u043a\u0435, \u044d\u043b\u043b\u0438\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0430\u0434\u0438\u0443\u0441 \u0440\u0438\u0441\u0443\u0435\u0442\u0441\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f <code>(x, y)<\/code>, \u0430 \u043a\u0440\u0443\u0433\u043e\u0432\u043e\u0439 \u0440\u0430\u0434\u0438\u0443\u0441 \u2013 \u0440\u0430\u0434\u0438\u0443\u0441\u0430 <code>R<\/code>.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ts\/p9\/od\/tsp9odsr991qqsfjymos7ylhfxs.png\"><\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 (a) \u0432\u044b\u0448\u0435, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0435 \u0444\u0438\u0433\u0443\u0440\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0441 \u0442\u043e\u0447\u043a\u0438 <code>p1<\/code>. \u041f\u0435\u0440\u0432\u0430\u044f \u0434\u0443\u0433\u0430 \u0440\u0438\u0441\u0443\u0435\u0442\u0441\u044f \u043e\u0442 \u0442\u043e\u0447\u043a\u0438 <code>p2<\/code> \u0434\u043e \u0442\u043e\u0447\u043a\u0438 <code>p3<\/code>, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0440\u0430\u0434\u0438\u0443\u0441 \u043d\u0435 \u0437\u0430\u0434\u0430\u043d, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0440\u0430\u0432\u0435\u043d <strong>\u043d\u0443\u043b\u044e<\/strong>, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043d\u0430\u0448\u0430 \u0434\u0443\u0433\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442, \u043a\u0430\u043a \u043f\u0440\u044f\u043c\u0430\u044f. \u0412\u0442\u043e\u0440\u0430\u044f \u0434\u0443\u0433\u0430 \u0442\u044f\u043d\u0435\u0442\u0441\u044f \u043e\u0442 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 <code>p4<\/code> \u0434\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 <code>p5<\/code> \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u0440\u0443\u0433\u043e\u0432\u043e\u0433\u043e \u0440\u0430\u0434\u0438\u0443\u0441\u0430 \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e \u0447\u0430\u0441\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0435\u043b\u043a\u0435 <em>(\u043f\u0440\u0438\u043c. \u043f\u043e \u0447\u0430\u0441\u043e\u0432\u043e\u0439 \u2013 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e)<\/em>. \u0422\u0440\u0435\u0442\u044c\u044f \u0434\u0443\u0433\u0430 \u0442\u044f\u043d\u0435\u0442\u0441\u044f \u043e\u0442 \u0442\u043e\u0447\u043a\u0438 <code>p6<\/code> \u0434\u043e \u0442\u043e\u0447\u043a\u0438 <code>p7<\/code>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043a\u0440\u0443\u0433\u043e\u0432\u043e\u0439 \u0440\u0430\u0434\u0438\u0443\u0441 \u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0442\u0438\u0432 \u0447\u0430\u0441\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0435\u043b\u043a\u0438. \u0427\u0435\u0442\u0432\u0435\u0440\u0442\u0430\u044f \u0434\u0443\u0433\u0430 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043e\u0442 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 <code>p8<\/code> \u0434\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 <code>p1<\/code>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u044d\u043b\u043b\u0438\u043f\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0440\u0430\u0434\u0438\u0443\u0441.<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">@override Path getClip(Size size) {    double radius = 20;    Path path = Path()       ..moveTo(radius, 0)     ..lineTo(size.width-radius, 0)     ..arcToPoint(Offset(size.width, radius))     ..lineTo(size.width, size.height - radius)     ..arcToPoint(Offset(size.width - radius, size.height),radius: Radius.circular(radius))     ..lineTo(radius, size.height)     ..arcToPoint(Offset(0, size.height - radius), radius: Radius.circular(radius), clockwise: false)     ..lineTo(0, radius)     ..arcToPoint(Offset(radius, 0), radius: Radius.elliptical(40, 20))     ..close();    return path; }<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"arcto\">arcTo<\/h2>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u0442\u044c \u0434\u0443\u0433\u0443, \u0437\u0430\u0434\u0430\u0432 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Radian\" rel=\"nofollow\">\u0440\u0430\u0434\u0438\u0430\u043d\u0430\u0445<\/a> <a href=\"https:\/\/api.flutter.dev\/flutter\/dart-ui\/Rect-class.html\" rel=\"nofollow\">Rect<\/a>, \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0443\u0433\u043e\u043b (startAngle) \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0443\u0433\u043e\u043b (sweepAngle).<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rv\/rl\/4y\/rvrl4yvulwhcro6qwfe1gtncqju.png\"><\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0435 \u0432\u044b\u0448\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u043e \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e\u0431 \u0443\u0433\u043b\u0430\u0445 \u0432 \u0440\u0430\u0434\u0438\u0430\u043d\u0430\u0445. \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0443\u0433\u043e\u043b \u0440\u0430\u0432\u0435\u043d 0 PI (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 PI \u0440\u0430\u0432\u043d\u043e ~3.14), \u043f\u043e\u043b\u043d\u044b\u0439 \u2013 2 PI.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bl\/qk\/jf\/blqkjf4do5kxrlv8mj1p091t9og.png\"><\/p>\n<p>  <\/p>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f <strong>Rect<\/strong>, \u043a\u0430\u043a \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u043e\u0447\u0435\u043a, \u043e\u043a\u0440\u0443\u0436\u043d\u043e\u0441\u0442\u0438, LTRB (Left, Top, Right, Bottom) \u0438 LTWH (Left, Top, Width, Height). \u041d\u0430 \u0432\u044b\u0448\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c \u0440\u0438\u0441\u0443\u043d\u043a\u0435 (a) \u0432\u0441\u0435 \u0442\u0438\u043f\u044b \u0434\u0443\u0433 \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u043d\u044b \u0441 \u0440\u0430\u0437\u043d\u044b\u043c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u043c \u0443\u0433\u043b\u043e\u043c.<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">@override Path getClip(Size size) {    double radius = 50;    Path path = Path()     ..lineTo(size.width - radius, 0)     ..arcTo(         Rect.fromPoints(             Offset(size.width - radius, 0), Offset(size.width, radius)), \/\/ Rect         1.5 * pi,   \/\/ \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0443\u0433\u043e\u043b         0.5 * pi,  \/\/ \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0443\u0433\u043e\u043b         true)  \/\/ \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e \u0447\u0430\u0441\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0435\u043b\u043a\u0435     ..lineTo(size.width, size.height - radius)     ..arcTo(Rect.fromCircle(center: Offset(size.width - radius, size.height - radius), radius: radius), 0, 0.5 * pi, false)     ..lineTo(radius, size.height)     ..arcTo(Rect.fromLTRB(0, size.height - radius, radius, size.height), 0.5 * pi, 0.5 * pi, false)     ..lineTo(0, radius)     ..arcTo(Rect.fromLTWH(0, 0, 70, 100), 1 * pi, 0.5 * pi, false)     ..close();    return path; }<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"addrect\">addRect<\/h2>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u043e\u0432. \u0415\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f <code>Rect<\/code>: <code>fromPoints<\/code>, <code>fromLTWH<\/code>, <code>fromCircle<\/code>, <code>fromLTRB<\/code> \u0438 <code>fromCircle<\/code>.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/8l\/a6\/y9\/8la6y9eb7h0hwgllooruaufivpo.png\"><\/p>\n<p>  <\/p>\n<pre><code class=\"java\"> @override Path getClip(Size size) {    Path path = Path()     ..addRect(Rect.fromPoints(Offset(0, 0), Offset(60, 60)))     ..addRect(Rect.fromLTWH(0, size.height - 50, 50, 50))     ..addRect(Rect.fromCircle(center: Offset(size.width \/ 2, size.height \/ 2), radius: 20))     ..close();    return path; }<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"addrrect\">addRRect<\/h2>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u044f\u043c\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430 \u0441 \u0437\u0430\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0443\u0433\u043b\u0430\u043c\u0438. \u041c\u043e\u0436\u043d\u043e \u0441\u043a\u0440\u0443\u0433\u043b\u0438\u0442\u044c, \u043a\u0430\u043a \u0432\u0441\u0435 \u0443\u0433\u043b\u044b \u0441\u0440\u0430\u0437\u0443, \u0442\u0430\u043a \u0438 \u043e\u0434\u0438\u043d.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gl\/tc\/vc\/gltcvccoyuxvqtljlqf9xmalumm.png\"><\/p>\n<p>  <\/p>\n<pre><code class=\"java\">@override Path getClip(Size size) {     double radius = 10;      Path path = Path()       ..addRRect(RRect.fromLTRBR(0, 0, 60, 60, Radius.circular(radius)))       ..addRRect(RRect.fromRectAndRadius(           Rect.fromLTWH(0, size.height - 50, 50, 50), Radius.circular(radius)))       ..addRRect(RRect.fromRectAndCorners(           Rect.fromCircle(               center: Offset(size.width \/ 2, size.height \/ 2), radius: 30           ),           topLeft: Radius.circular(radius)))       ..close();      return path; }<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"addoval\">addOval<\/h2>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043e\u0432\u0430\u043b\u0430. \u041a\u0430\u043a \u0438 \u0434\u043b\u044f <code>addRect<\/code>, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0442\u0438\u043f\u0430 <code>Rect<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/2m\/by\/_y\/2mby_yatz-jzk2pzzyowqkwvluq.png\"><\/p>\n<p>  <\/p>\n<pre><code class=\"java\">@override Path getClip(Size size) {      Path path = Path()       ..addOval(Rect.fromPoints(Offset(0, 0), Offset(60, 60)))       ..addOval(Rect.fromLTWH(0, size.height - 50, 100, 50))       ..addOval(Rect.fromCircle(center: Offset(size.width \/ 2, size.height \/ 2), radius: 20))       ..close();     return path;  }<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"addpolygon\">addPolygon<\/h2>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f <a href=\"https:\/\/en.wikipedia.org\/wiki\/Polygon\" rel=\"nofollow\">\u043c\u043d\u043e\u0433\u043e\u0443\u0433\u043e\u043b\u044c\u043d\u0438\u043a\u0430<\/a> \u043f\u0443\u0442\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0442\u043e\u0447\u0435\u043a.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/cm\/ej\/wu\/cmejwukvykhlykcvjyq4gck3ghi.png\"><\/p>\n<p>  <\/p>\n<pre><code class=\"java\">@override Path getClip(Size size) {     var points = [       Offset(size.width \/ 2, 0), \/\/ \u0442\u043e\u0447\u043a\u0430 p1       Offset(0, size.height \/ 2), \/\/ \u0442\u043e\u0447\u043a\u0430 p2       Offset(size.width \/ 2, size.height), \/\/ \u0442\u043e\u0447\u043a\u0430 p3       Offset(size.width, size.height \/ 2) \/\/ \u0442\u043e\u0447\u043a\u0430 p4     ];       Path path = Path()       ..addPolygon(points, false)       ..close();      return path; }<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"addpath\">addPath<\/h2>\n<p>  <\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u043d\u0430\u0434\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0435\u0449\u0451 \u043e\u0434\u043d\u0443 \u0444\u0438\u0433\u0443\u0440\u0443 \u043d\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043a \u0443\u0436\u0435 \u0438\u043c\u0435\u044e\u0449\u0435\u0439\u0441\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0444\u0438\u0433\u0443\u0440\u044b \u0438 \u0441\u0434\u0432\u0438\u0433 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0442\u043e\u0447\u043a\u0438 \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u043c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u043d\u043e\u0432\u043e\u0439 \u0444\u0438\u0433\u0443\u0440\u044b.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/a6\/wk\/0i\/a6wk0iwhj1uwpsiqk5awd6z-vs0.png\"><\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 (a), \u0435\u0441\u0442\u044c \u0434\u0432\u0435 \u0444\u0438\u0433\u0443\u0440\u044b (<code>path 1<\/code> \u0438 <code>path 2<\/code>), <code>path 1<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439, \u0430 <code>path 2<\/code> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 <code>path 1<\/code>. <code>path 2<\/code> \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0432\u0438\u0438 \u0441\u043e \u0441\u0434\u0432\u0438\u0433\u043e\u043c <code>(w\/2, 0)<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0447\u0430\u043b\u043e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 <code>(0, 0)<\/code> \u0438 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u044e\u0442\u0441\u044f \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f.<\/p>\n<p>  <\/p>\n<pre><code class=\"java\">@override Path getClip(Size size) {      Path path1 = Path()       ..lineTo(0, size.height)       ..lineTo(size.width\/2, size.height)       ..lineTo(0, 0);      Path path2 = Path()       ..lineTo(size.width\/2, size.height)       ..lineTo(size.width\/2, 0)       ..lineTo(0, 0);      path1.addPath(path2, Offset(size.width\/2,0));      return path1; }<\/code><\/pre>\n<p>  <\/p>\n<h2 id=\"relativelineto\">relativeLineTo<\/h2>\n<p>  <\/p>\n<p>\u042d\u0442\u043e\u0442 \u043c\u0435\u0442\u043e\u0434 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d \u043c\u0435\u0442\u043e\u0434\u0443 <code>lineTo<\/code>, \u043d\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u043b\u0438\u043d\u0438\u0438 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u043e\u0447\u043d\u043e\u0439 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u043e\u0439, \u0430 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435\u043c \u0438\u0437 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/j2\/gq\/xl\/j2gqxlcepo5j8lyga9dwpumg06w.png\"><\/p>\n<p>  <\/p>\n<p>\u041d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 (a) \u043b\u0438\u043d\u0438\u044f <code>p1p2<\/code> \u0440\u0438\u0441\u0443\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>relativeLineTo<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430 \u0442\u043e\u0447\u043a\u0438 <code>p2<\/code> \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e <code>p1<\/code>. \u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0432\u0438\u0434\u0435 \u0444\u043e\u0440\u043c\u0443\u043b\u044b <code>p2(x, y) = (p1.x + 50, p1.y + h)<\/code><\/p>\n<p>  <\/p>\n<pre><code class=\"java\">@override Path getClip(Size size) {      Path path = Path()       ..moveTo(size.width\/2, 0)       ..relativeLineTo(50, size.height)       ..lineTo(size.width , size.height)       ..close();      return path; }<\/code><\/pre>\n<p>  <\/p>\n<blockquote><p>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: <code>relativeMoveTo<\/code>, <code>relativeQuadraticBezierTo<\/code>, <code>relativeArcToPoint<\/code>, <code>relativeCubicTo<\/code> \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 <code>quadraticBezierTo<\/code>, <code>arcToPoint<\/code>, <code>cubicTo<\/code> \u043f\u043e \u0442\u043e\u043c\u0443 \u0436\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443, \u0447\u0442\u043e \u0438 <code>relativeLineTo<\/code> \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a <code>lineTo<\/code>.<\/p><\/blockquote>\n<p>  <\/p>\n<hr>\n<p>  <\/p>\n<p>\u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0431\u0443\u0434\u0435\u0442 \u0432\u0430\u043c \u043f\u043e\u043b\u0435\u0437\u0435\u043d \u0438 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u043d\u044b\u0435 \u0444\u0438\u0433\u0443\u0440\u044b.<\/p>\n<p>  <\/p>\n<hr>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/KinjalDhamat312\/FlutterCustomClipper\" rel=\"nofollow\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 Github<\/a><\/li>\n<li>\u041f\u0440\u043e\u0435\u043a\u0442 <a href=\"https:\/\/pub.dev\/packages\/flutter_chat_bubble\/versions\/1.0.2\" rel=\"nofollow\">flutter_chat_bubble<\/a>, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>CustomClipper<\/code><\/li>\n<\/ul>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/509384\/\"> https:\/\/habr.com\/ru\/post\/509384\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/509384\/\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/_f\/0j\/f9\/_f0jf9hlqb9w7q4xyrhcwmfcitk.png\"><\/p>\n<p>  <\/p>\n<p>Flutter \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0432\u0438\u0434\u0436\u0435\u0442\u044b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0444\u0438\u0433\u0443\u0440, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/api.flutter.dev\/flutter\/widgets\/ClipRect-class.html\" rel=\"nofollow\">ClipRect<\/a>, <a href=\"https:\/\/api.flutter.dev\/flutter\/widgets\/ClipRRect-class.html\" rel=\"nofollow\">ClipRRect<\/a>, <a href=\"https:\/\/api.flutter.dev\/flutter\/widgets\/ClipOval\/ClipOval.html\" rel=\"nofollow\">ClipOval<\/a>. \u041d\u043e \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c <a href=\"https:\/\/api.flutter.dev\/flutter\/widgets\/ClipPath-class.html\" rel=\"nofollow\">ClipPath<\/a>, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0442\u0438\u043f\u044b \u0444\u0438\u0433\u0443\u0440.<\/p>\n<p>  <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u043c\u0441\u044f \u043d\u0430 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <a href=\"https:\/\/api.flutter.dev\/flutter\/widgets\/ClipPath-class.html\" rel=\"nofollow\">ClipPath<\/a> \u0438 <a href=\"https:\/\/api.flutter.dev\/flutter\/rendering\/CustomClipper-class.html\" rel=\"nofollow\">CustomClipper<\/a>. \u041f\u043e\u0435\u0445\u0430\u043b\u0438!<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-306487","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/306487","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=306487"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/306487\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=306487"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=306487"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=306487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}