Skip to content

Conversation

martincapello
Copy link
Member

Fix #2184

Copy link
Collaborator

@aseprite-bot aseprite-bot left a 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;
Copy link
Collaborator

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]

Suggested change
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;
Copy link
Collaborator

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]

Suggested change
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;
Copy link
Collaborator

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]

Suggested change
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;
Copy link
Collaborator

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]

Suggested change
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;
Copy link
Collaborator

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]

Suggested change
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;
Copy link
Collaborator

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]

Suggested change
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;
Copy link
Collaborator

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]

Suggested change
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;
Copy link
Collaborator

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]

Suggested change
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;
Copy link
Collaborator

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]

Suggested change
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;
Copy link
Collaborator

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]

Suggested change
int fixy = sy - 2 * offsety;
int const fixy = sy - 2 * offsety;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants