diff --git a/src/yaw-tab/ui.cpp b/src/yaw-tab/ui.cpp index 7864c87..ee84d3d 100644 --- a/src/yaw-tab/ui.cpp +++ b/src/yaw-tab/ui.cpp @@ -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(300 * tabletAspectRatio), true, false); + float tabletAspectRatio = tab.ext.x ? tab.ext.y / tab.ext.x : 1.f; + setGeometryConstraints(400, static_cast(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(ev.size.getWidth()); + int y = static_cast(ev.size.getHeight()); AButtonWidget.setAbsolutePos(x - 100, y - 100); BButtonWidget.setAbsolutePos(x - 100, y - 200); return UI::onResize(ev);