blob: 35d9179f94f958a3f64a0ddcf3f2cd7b536d1a44 [file] [log] [blame]
Hal Canary83c2f702019-03-07 14:53:03 -05001#if 0 // Disabled until updated to use current API.
2// Copyright 2019 Google LLC.
3// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
4#include "fiddle/examples.h"
5// HASH=81345f7619a072bb2b0cf59810fe86d0
6REG_FIDDLE(RRect_014, 256, 100, false, 0) {
7void draw(SkCanvas* canvas) {
8 auto drawDetails = [=](const SkRRect& rrect) {
9 SkPaint paint;
10 paint.setAntiAlias(true);
11 paint.setTextSize(12);
12 canvas->drawRRect(rrect, paint);
13 SkVector corner = rrect.getSimpleRadii();
14 std::string label = "corner: " + std::to_string(corner.fX).substr(0, 3) + ", " +
15 std::to_string(corner.fY).substr(0, 3);
16 canvas->drawString(label.c_str(), 64, 90, paint);
17 canvas->translate(128, 0);
18 };
19 SkRRect rrect = SkRRect::MakeRect({30, 10, 100, 60});
20 drawDetails(rrect);
21 rrect.setRectXY(rrect.getBounds(), 5, 8);
22 drawDetails(rrect);
23}
24} // END FIDDLE
25#endif // Disabled until updated to use current API.