blob: 411480eef0e925c4063ff282f0235f27cc16a540 [file] [log] [blame]
Hal Canary87515122019-03-15 14:22:51 -04001#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.
Mike Kleinc0bd9f92019-04-23 12:05:21 -05004#include "tools/fiddle/examples.h"
Hal Canary87515122019-03-15 14:22:51 -04005// HASH=81345f7619a072bb2b0cf59810fe86d0
Hal Canarya7181e7c2019-03-18 16:06:34 -04006REG_FIDDLE(RRect_getSimpleRadii, 256, 100, false, 0) {
Hal Canary87515122019-03-15 14:22:51 -04007void 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.