Skip to content
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

fix: out of bound error in string when preview module #1

Merged
merged 1 commit into from
Dec 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/FUNKTION.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,8 @@ struct FUNKTIONDisplay : TransparentWidget {
void drawLayer(const DrawArgs &args, int layer) override {
if (layer ==1) {
shared_ptr<Font> font = APP->window->loadFont(asset::plugin(pluginInstance, "res/LEDCalculator.ttf"));
std::string fD= module ? module->fctDesc : "sin";
std::string to_display = "";
for (int i=0; i<14; i++) to_display = to_display + fD[i];
std::string to_display= module ? module->fctDesc : "sin";
to_display.resize(14);
nvgFontSize(args.vg, 24);
nvgFontFaceId(args.vg, font->handle);
nvgTextLetterSpacing(args.vg, 0);
Expand Down
5 changes: 2 additions & 3 deletions src/LABEL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,8 @@ struct LABELDisplay : TransparentWidget {
void drawLayer(const DrawArgs &args, int layer) override {
if (layer ==1) {
shared_ptr<Font> font = APP->window->loadFont(asset::plugin(pluginInstance, "res/LEDCalculator.ttf"));
std::string fD= module ? module->fileDesc : "Right click to write";
std::string to_display = "";
for (int i=0; i<20; i++) to_display = to_display + fD[i];
std::string to_display= module ? module->fileDesc : "Right click to write";
to_display.resize(20);
nvgFontSize(args.vg, 24);
nvgFontFaceId(args.vg, font->handle);
nvgTextLetterSpacing(args.vg, 0);
Expand Down
5 changes: 2 additions & 3 deletions src/PLAY.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,8 @@ struct PLAYDisplay : TransparentWidget {
void drawLayer(const DrawArgs &args, int layer) override {
if (layer ==1) {
shared_ptr<Font> font = APP->window->loadFont(asset::plugin(pluginInstance, "res/LEDCalculator.ttf"));
std::string fD= module ? module->fileDesc : "load sample";
std::string to_display = "";
for (int i=0; i<14; i++) to_display = to_display + fD[i];
std::string to_display= module ? module->fileDesc : "load sample ";
to_display.resize(14);
nvgFontSize(args.vg, 24);
nvgFontFaceId(args.vg, font->handle);
nvgTextLetterSpacing(args.vg, 0);
Expand Down