Fix border display drawing for menus. Fix scrollable window components that went outside to use proper scrolling offsets. Fix issue with same-frame clicking and releasing causing a different button to be selected.

This commit is contained in:
2023-12-15 23:57:09 -06:00
parent 92c093c589
commit 025a89788e
22 changed files with 103 additions and 101 deletions
+4 -4
View File
@@ -54,16 +54,16 @@ protected:
virtual void inline Update(Crawler*game)override{
MenuLabel::Update(game);
}
virtual void inline DrawDecal(ViewPort&window,vf2d parentPos,bool focused)override{
MenuLabel::DrawDecal(window,parentPos,focused);
vi2d iconPos=parentPos+rect.pos+vi2d{5,5};
virtual void inline DrawDecal(ViewPort&window,bool focused)override{
MenuLabel::DrawDecal(window,focused);
vi2d iconPos=rect.pos+vi2d{5,5};
vi2d textPos=iconPos;
float textWidth=game->GetTextSizeProp(ability->input->GetDisplayName()).x*0.5f+4;
float boxWidth=rect.size.y-4; //No, the y is not a typo. It's a square, we use the y to determine the x.
window.DrawRectDecal(parentPos+rect.pos+vi2d{2,2},vi2d{int(rect.size.y)-4,int(rect.size.y)-4});
window.DrawRectDecal(rect.pos+vi2d{2,2},vi2d{int(rect.size.y)-4,int(rect.size.y)-4});
window.DrawDecal(iconPos,GFX[ability->icon].Decal());
vi2d descriptionPos=iconPos+vi2d{int(rect.size.y)-2,-1};