mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-13 19:44:28 +00:00
sw_engine: --compiler warning
../src/lib/sw_engine/tvgSwShape.cpp:232:28: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare] 232 | for (auto i = 0; i < dash.cnt; ++i) patternLength += pattern[i]; | ~~^~~~~~~~~~ ../src/lib/sw_engine/tvgSwShape.cpp:239:28: warning: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare] 239 | for (auto i = 0; i < dash.cnt * (1 + isOdd); ++i, ++offIdx) {
This commit is contained in:
parent
cb36c25aff
commit
001c1c06fc
1 changed files with 2 additions and 2 deletions
|
@ -229,14 +229,14 @@ static SwOutline* _genDashOutline(const RenderShape* rshape, const Matrix* trans
|
|||
auto patternLength = 0.0f;
|
||||
uint32_t offIdx = 0;
|
||||
if (fabsf(offset) > FLT_EPSILON) {
|
||||
for (auto i = 0; i < dash.cnt; ++i) patternLength += pattern[i];
|
||||
for (size_t i = 0; i < dash.cnt; ++i) patternLength += pattern[i];
|
||||
bool isOdd = dash.cnt % 2;
|
||||
if (isOdd) patternLength *= 2;
|
||||
|
||||
if (offset < 0) offset = patternLength + fmod(offset, patternLength);
|
||||
else offset = fmod(offset, patternLength);
|
||||
|
||||
for (auto i = 0; i < dash.cnt * (1 + isOdd); ++i, ++offIdx) {
|
||||
for (size_t i = 0; i < dash.cnt * (1 + isOdd); ++i, ++offIdx) {
|
||||
auto curPattern = pattern[i % dash.cnt];
|
||||
if (offset < curPattern) break;
|
||||
offset -= curPattern;
|
||||
|
|
Loading…
Add table
Reference in a new issue