Skip to content

Commit 0259f46

Browse files
committed
feat: ZKGraphics add drawRRect method
feat: ZKGraphics add drawRRect method
1 parent f70f4cf commit 0259f46

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 2.7.5
2+
- ZKGraphics add drawRRect method.
3+
14
# 2.7.2
25
- Modify the node reset registration point to 0.5.
36

lib/src/node/graphic.dart

+12
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ class ZKGraphic extends ZKNode {
7373
this._addDrawList("drawRect", Rect.fromLTRB(x, y, x + w, y + h));
7474
}
7575

76+
void drawRRect(double x, double y, double w, double h, [double radius = 10]) {
77+
Rect rect = Rect.fromLTRB(x, y, x + w, y + h);
78+
RRect rrect = RRect.fromRectAndRadius(rect, Radius.circular(radius));
79+
this._addDrawList("drawRRect", rrect);
80+
}
81+
7682
void drawCircle(double x, double y, double radius) {
7783
this._addDrawList("drawCircle", Offset(x, y), radius);
7884
}
@@ -144,6 +150,12 @@ class ZKGraphic extends ZKNode {
144150
}
145151
break;
146152

153+
case "drawRRect":
154+
{
155+
canvas?.drawRRect(item["parm1"], item["paint"]);
156+
}
157+
break;
158+
147159
case "drawCircle":
148160
{
149161
canvas?.drawCircle(item["parm1"], item["parm2"], item["paint"]);

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ description: Zerker is a flexible and lightweight flutter canvas graphic animati
1111
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
1212
# Read more about iOS versioning at
1313
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
14-
version: 2.7.2
14+
version: 2.7.5
1515
homepage: https://github.com/flutterkit/zerker
1616

1717
environment:

0 commit comments

Comments
 (0)