-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Add rounded rectangle support #5405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: beta
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
int r = 0; | ||
if (cornerRadius > 1) { | ||
int w = x2 - x1; | ||
int h = y2 - y1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'h' of type 'int' can be declared 'const' [misc-const-correctness]
int h = y2 - y1; | |
int const h = y2 - y1; |
if (cornerRadius > 1) { | ||
int w = x2 - x1; | ||
int h = y2 - y1; | ||
int xm = x1 + w / 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'xm' of type 'int' can be declared 'const' [misc-const-correctness]
int xm = x1 + w / 2; | |
int const xm = x1 + w / 2; |
int w = x2 - x1; | ||
int h = y2 - y1; | ||
int xm = x1 + w / 2; | ||
int ym = y1 + h / 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'ym' of type 'int' can be declared 'const' [misc-const-correctness]
int ym = y1 + h / 2; | |
int const ym = y1 + h / 2; |
int r = 0; | ||
if (cornerRadius > 1) { | ||
int w = x2 - x1; | ||
int h = y2 - y1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'h' of type 'int' can be declared 'const' [misc-const-correctness]
int h = y2 - y1; | |
int const h = y2 - y1; |
if (cornerRadius > 1) { | ||
int w = x2 - x1; | ||
int h = y2 - y1; | ||
int xm = x1 + w / 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'xm' of type 'int' can be declared 'const' [misc-const-correctness]
int xm = x1 + w / 2; | |
int const xm = x1 + w / 2; |
int offsetx = sx / 2; | ||
int offsety = sy / 2; | ||
int fixx = sx - 2 * offsetx; | ||
int fixy = sy - 2 * offsety; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'fixy' of type 'int' can be declared 'const' [misc-const-correctness]
int fixy = sy - 2 * offsety; | |
int const fixy = sy - 2 * offsety; |
int x = -r, y = 0, err = 2 - 2 * r; /* II. Quadrant */ | ||
sx = sx < 0 ? 0 : sx; | ||
sy = sy < 0 ? 0 : sy; | ||
int offsetx = sx / 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'offsetx' of type 'int' can be declared 'const' [misc-const-correctness]
int offsetx = sx / 2; | |
int const offsetx = sx / 2; |
sx = sx < 0 ? 0 : sx; | ||
sy = sy < 0 ? 0 : sy; | ||
int offsetx = sx / 2; | ||
int offsety = sy / 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'offsety' of type 'int' can be declared 'const' [misc-const-correctness]
int offsety = sy / 2; | |
int const offsety = sy / 2; |
sy = sy < 0 ? 0 : sy; | ||
int offsetx = sx / 2; | ||
int offsety = sy / 2; | ||
int fixx = sx - 2 * offsetx; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'fixx' of type 'int' can be declared 'const' [misc-const-correctness]
int fixx = sx - 2 * offsetx; | |
int const fixx = sx - 2 * offsetx; |
int offsetx = sx / 2; | ||
int offsety = sy / 2; | ||
int fixx = sx - 2 * offsetx; | ||
int fixy = sy - 2 * offsety; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'fixy' of type 'int' can be declared 'const' [misc-const-correctness]
int fixy = sy - 2 * offsety; | |
int const fixy = sy - 2 * offsety; |
Fix #2184