mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-04-10 17:50:28 -04:00
UI: Remove fractional scaling ifdefs
Among the systems we officially support, the oldest Qt version is Qt 5.9 on Ubuntu 18.04. Fractional scaling is supported in Qt 5.6 and newer. We should be able to safely remove these ifdefs.
This commit is contained in:
@@ -13,9 +13,6 @@
|
||||
|
||||
#define HANDLE_RADIUS 4.0f
|
||||
#define HANDLE_SEL_RADIUS (HANDLE_RADIUS * 1.5f)
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
|
||||
#define SUPPORTS_FRACTIONAL_SCALING
|
||||
#endif
|
||||
|
||||
/* TODO: make C++ math classes and clean up code here later */
|
||||
|
||||
@@ -44,11 +41,7 @@ OBSBasicPreview::~OBSBasicPreview()
|
||||
vec2 OBSBasicPreview::GetMouseEventPos(QMouseEvent *event)
|
||||
{
|
||||
OBSBasic *main = reinterpret_cast<OBSBasic *>(App()->GetMainWindow());
|
||||
#ifdef SUPPORTS_FRACTIONAL_SCALING
|
||||
float pixelRatio = main->devicePixelRatioF();
|
||||
#else
|
||||
float pixelRatio = main->devicePixelRatio();
|
||||
#endif
|
||||
float scale = pixelRatio / main->previewScale;
|
||||
vec2 pos;
|
||||
vec2_set(&pos,
|
||||
@@ -406,11 +399,7 @@ void OBSBasicPreview::GetStretchHandleData(const vec2 &pos, bool ignoreGroup)
|
||||
if (!scene)
|
||||
return;
|
||||
|
||||
#ifdef SUPPORTS_FRACTIONAL_SCALING
|
||||
float scale = main->previewScale / main->devicePixelRatioF();
|
||||
#else
|
||||
float scale = main->previewScale / main->devicePixelRatio();
|
||||
#endif
|
||||
vec2 scaled_pos = pos;
|
||||
vec2_divf(&scaled_pos, &scaled_pos, scale);
|
||||
HandleFindData data(scaled_pos, scale);
|
||||
@@ -533,11 +522,7 @@ void OBSBasicPreview::mousePressEvent(QMouseEvent *event)
|
||||
}
|
||||
|
||||
OBSBasic *main = reinterpret_cast<OBSBasic *>(App()->GetMainWindow());
|
||||
#ifdef SUPPORTS_FRACTIONAL_SCALING
|
||||
float pixelRatio = main->devicePixelRatioF();
|
||||
#else
|
||||
float pixelRatio = main->devicePixelRatio();
|
||||
#endif
|
||||
float x = float(event->x()) - main->previewX / pixelRatio;
|
||||
float y = float(event->y()) - main->previewY / pixelRatio;
|
||||
Qt::KeyboardModifiers modifiers = QGuiApplication::keyboardModifiers();
|
||||
@@ -1552,11 +1537,7 @@ void OBSBasicPreview::mouseMoveEvent(QMouseEvent *event)
|
||||
mousePos = pos;
|
||||
OBSBasic *main = reinterpret_cast<OBSBasic *>(
|
||||
App()->GetMainWindow());
|
||||
#ifdef SUPPORTS_FRACTIONAL_SCALING
|
||||
float scale = main->devicePixelRatioF();
|
||||
#else
|
||||
float scale = main->devicePixelRatio();
|
||||
#endif
|
||||
float x = float(event->x()) - main->previewX / scale;
|
||||
float y = float(event->y()) - main->previewY / scale;
|
||||
vec2_set(&startPos, x, y);
|
||||
|
||||
Reference in New Issue
Block a user