Fix for Touch

This commit is contained in:
tobid7 2022-05-08 05:00:11 +02:00
parent 690dd1d6ca
commit d4f12cb9b0
2 changed files with 7 additions and 0 deletions

View File

@ -839,6 +839,12 @@ bool RenderD7::touchTObj(touchPosition touch, RenderD7::TObject button)
else return false;
}
bool RenderD7::touchTLBtn(touchPosition touch, RenderD7::TLBtn button)
{
if (touch.px >= button.x && touch.px <= (button.x + button.w) && touch.py >= button.y && touch.py <= (button.y + button.h)) return true;
else return false;
}
int RenderD7::GetRandomInt(int b, int e)
{
std::default_random_engine generator;

View File

@ -348,6 +348,7 @@ namespace RenderD7
void DrawTObjects(std::vector<RenderD7::TObject> tobjects, u32 color, u32 txtcolor, int selection = -1, u32 selbgcolor = RenderD7::Color::Hex("#2D98AF"), u32 selcolor = RenderD7::Color::Hex("#000000"));
void DrawSTObject(std::vector<RenderD7::TObject> tobject, int tobjectindex, u32 color, u32 txtcolor);
bool touchTObj(touchPosition touch, RenderD7::TObject button);
bool touchTLBtn(touchPosition touch, RenderD7::TLBtn button);
void DrawTLBtns(std::vector<RenderD7::TLBtn> btns, u32 color, int selection = -1, u32 selbgcolor = RenderD7::Color::Hex("#2D98AF"), u32 selcolor = RenderD7::Color::Hex("#000000"));
struct Checkbox