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
+3 -3
View File
@@ -131,13 +131,13 @@ protected:
}
}
}
virtual inline void DrawDecal(ViewPort&window,vf2d parentPos,bool focused)override{
MenuIconButton::DrawDecal(window,parentPos,focused);
virtual inline void DrawDecal(ViewPort&window,bool focused)override{
MenuIconButton::DrawDecal(window,focused);
if(valid&&!hideQty){
std::string quantityText="x"+std::to_string(itemRef.get().Amt());
vf2d quantityTextScale=rect.size/48.f;
vf2d textSize=vf2d(game->GetTextSizeProp(quantityText))*quantityTextScale;
vf2d drawPos=parentPos+rect.pos+rect.size-textSize;
vf2d drawPos=rect.pos+rect.size-textSize;
geom2d::rect<float>boundingBox={drawPos,textSize};
window.DrawShadowStringDecal(drawPos,quantityText,WHITE,BLACK,quantityTextScale,quantityTextScale.x);
}