Skip to content

Commit 22a91fb

Browse files
committed
ResizeHandle is now GL3 compatible
Signed-off-by: falkTX <falktx@falktx.com>
1 parent 6f4b094 commit 22a91fb

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

generic/ResizeHandle.hpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* Resize handle for DPF
3-
* Copyright (C) 2021-2022 Filipe Coelho <falktx@falktx.com>
3+
* Copyright (C) 2021-2025 Filipe Coelho <falktx@falktx.com>
44
*
55
* Permission to use, copy, modify, and/or distribute this software for any purpose with
66
* or without fee is hereby granted, provided that the above copyright notice and this
@@ -19,7 +19,7 @@
1919
#include "TopLevelWidget.hpp"
2020
#include "Color.hpp"
2121

22-
#if defined(DGL_OPENGL) && !defined(DGL_USE_OPENGL3)
22+
#ifdef DGL_OPENGL
2323
#include "OpenGL-include.hpp"
2424
#endif
2525

@@ -60,8 +60,7 @@ class ResizeHandle : public TopLevelWidget
6060
protected:
6161
void onDisplay() override
6262
{
63-
// TODO implement gl3 stuff in DPF
64-
#ifndef DGL_USE_OPENGL3
63+
#ifdef DGL_OPENGL
6564
const GraphicsContext& context(getGraphicsContext());
6665
const double lineWidth = 1.0 * getScaleFactor();
6766

@@ -84,7 +83,7 @@ class ResizeHandle : public TopLevelWidget
8483
l1b.draw(context, lineWidth);
8584
l2b.draw(context, lineWidth);
8685
l3b.draw(context, lineWidth);
87-
#endif
86+
#endif
8887
}
8988

9089
bool onMouse(const MouseEvent& ev) override
@@ -167,7 +166,13 @@ class ResizeHandle : public TopLevelWidget
167166
return;
168167

169168
hasCursor = shouldHaveCursor;
170-
setCursor(shouldHaveCursor ? kMouseCursorDiagonal : kMouseCursorArrow);
169+
setCursor(shouldHaveCursor ?
170+
#ifdef DGL_ALLOW_DEPRECATED_METHODS
171+
kMouseCursorUpLeftDownRight
172+
#else
173+
kMouseCursorDiagonal
174+
#endif
175+
: kMouseCursorArrow);
171176
}
172177

173178
void resetArea()

0 commit comments

Comments
 (0)