This commit is contained in:
ZakatTeamI2P 2026-03-31 02:29:05 +04:00
parent 42345d72db
commit cc14085fc0
2 changed files with 7 additions and 11 deletions

View File

@ -82,7 +82,6 @@ static const RbException excToRbExc[] =
void raiseRbExc(const Exception &exc){ void raiseRbExc(const Exception &exc){
RbData *data = getRbData(); RbData *data = getRbData();
VALUE excClass = data->exc[excToRbExc[exc.type]]; VALUE excClass = data->exc[excToRbExc[exc.type]];
rb_raise(excClass, "%s", exc.msg.c_str()); rb_raise(excClass, "%s", exc.msg.c_str());
} }

View File

@ -477,19 +477,17 @@ struct SettingsMenuPrivate
TTF_SetFontStyle(font, TTF_STYLE_NORMAL); TTF_SetFontStyle(font, TTF_STYLE_NORMAL);
} }
SDL_Surface *createTextSurface(const char *str, bool bold) SDL_Surface *createTextSurface(const char *str, bool bold){
{ //SDL_Color c = { cText, cText, cText, 255 };
SDL_Color c = { cText, cText, cText, 255 };
applyFontStyle(bold); applyFontStyle(bold);
return TTF_RenderText_Blended(font, str, c); return TTF_RenderText_Blended(font, str, strlen(str), c);
} }
SDL_Surface *createTextSurface(const char *str, SDL_Color c, SDL_Surface *createTextSurface(const char *str, SDL_Color c, bool bold)
bool bold)
{ {
applyFontStyle(bold); applyFontStyle(bold);
return TTF_RenderText_Blended(font, str, c); return TTF_RenderText_Blended(font, str, strlen(str), c);
} }
/* Horizontally centered */ /* Horizontally centered */
@ -1222,11 +1220,10 @@ bool SettingsMenu::onEvent(const SDL_Event &event,
case SDL_EVENT_KEY_DOWN: case SDL_EVENT_KEY_DOWN:
if (p->state != AwaitingInput) if (p->state != AwaitingInput)
{ {
if (event.key.sym == SDLK_RETURN) if (event.key.key == SDLK_RETURN)
p->onAccept(); p->onAccept();
else if (event.key.sym == SDLK_ESCAPE) else if (event.key.key == SDLK_ESCAPE)
p->onCancel(); p->onCancel();
return true; return true;
} }