Browse Source

Fix possible undefined variable in NanoVG::textBounds

tags/v1.9.11
falkTX 6 years ago
parent
commit
43bc30fa90
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      source/modules/dgl/src/NanoVG.cpp

+ 1
- 1
source/modules/dgl/src/NanoVG.cpp View File

@@ -863,7 +863,7 @@ float NanoVG::textBounds(float x, float y, const char* string, const char* end,
if (fContext == nullptr) return 0.0f; if (fContext == nullptr) return 0.0f;
DISTRHO_SAFE_ASSERT_RETURN(string != nullptr && string[0] != '\0', 0.0f); DISTRHO_SAFE_ASSERT_RETURN(string != nullptr && string[0] != '\0', 0.0f);


float b[4];
float b[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
const float ret = nvgTextBounds(fContext, x, y, string, end, b); const float ret = nvgTextBounds(fContext, x, y, string, end, b);
bounds = Rectangle<float>(b[0], b[1], b[2] - b[0], b[3] - b[1]); bounds = Rectangle<float>(b[0], b[1], b[2] - b[0], b[3] - b[1]);
return ret; return ret;


Loading…
Cancel
Save