resizing and button logic

This commit is contained in:
yaw-man 2022-08-18 16:17:49 -03:00
parent 025f80b1e1
commit b5a8b01804
1 changed files with 5 additions and 4 deletions

View File

@ -32,7 +32,7 @@ void ButtonMappingWidget::onNanoDisplay()
beginPath();
strokeColor(200, 200, 200);
fillColor(0.5f, 0.5f, 0.5f, 0.5f * (isClicked + isPenPressed));
roundedRect(0.f, 0.f, size, size, 0.5f * size);
roundedRect(0.f, 0.f, size, size, 0.25f * size);
stroke();
fill();
closePath();
@ -62,7 +62,8 @@ TabUI::TabUI()
if (!tab.initialized)
return;
// setGeometryConstraints(400, static_cast<uint>(300 * tabletAspectRatio), true, false);
float tabletAspectRatio = tab.ext.x ? tab.ext.y / tab.ext.x : 1.f;
setGeometryConstraints(400, static_cast<uint>(300 * tabletAspectRatio), true, false);
}
void TabUI::getTabletData()
@ -143,8 +144,8 @@ bool TabUI::onMouse(const MouseEvent &ev)
void TabUI::onResize(const ResizeEvent &ev)
{
float x = ev.size.getWidth();
float y = ev.size.getHeight();
int x = static_cast<int>(ev.size.getWidth());
int y = static_cast<int>(ev.size.getHeight());
AButtonWidget.setAbsolutePos(x - 100, y - 100);
BButtonWidget.setAbsolutePos(x - 100, y - 200);
return UI::onResize(ev);