Debian Codegraph @

docs/examples/Path_arcTo.cpp

raw
1 // Copyright 2019 Google LLC.
2 // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
3 #include "tools/fiddle/examples.h"
4 REG_FIDDLE(Path_arcTo, 256, 200, false, 0) {
5 void draw(SkCanvas* canvas) {
6 SkPaint paint;
7 paint.setStyle(SkPaint::kStroke_Style);
8 paint.setStrokeWidth(4);
9 SkPath path = SkPathBuilder()
10 .moveTo(0, 0)
11 .arcTo({20, 20, 120, 120}, -90, 90, false)
12 .detach();
13 canvas->drawPath(path, paint);
14 path = SkPathBuilder()
15 .arcTo({120, 20, 220, 120}, -90, 90, false)
16 .detach();
17 canvas->drawPath(path, paint);
18 path = SkPathBuilder()
19 .moveTo(0, 0)
20 .arcTo({20, 120, 120, 220}, -90, 90, true)
21 .detach();
22 canvas->drawPath(path, paint);
23 }
24 } // END FIDDLE