Skip to content

Commit f6c72e9

Browse files
committed
remove hack to set the NanoVG device pixel ratio early on
1 parent e6b4816 commit f6c72e9

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

ext/nanovg

src/example1.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@
4444
#if defined(_MSC_VER)
4545
# pragma warning (disable: 4505) // don't warn about dead code in stb_image.h
4646
#elif defined(__GNUC__)
47-
# pragma GCC diagnostic ignored "-Wunused-function"
47+
# pragma GCC diagnostic ignored "-Wunused-function"
4848
#endif
49+
4950
#include <stb_image.h>
5051

5152
using namespace nanogui;

src/screen.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,7 @@ void Screen::initialize(GLFWwindow *window, bool shutdown_glfw) {
499499

500500
if (!m_nvg_context)
501501
throw std::runtime_error("Could not initialize NanoVG!");
502+
nvgSetDevicePixelRatio(m_nvg_context, m_pixel_ratio);
502503

503504
m_visible = glfwGetWindowAttrib(window, GLFW_VISIBLE) != 0;
504505
set_theme(new Theme(m_nvg_context));
@@ -549,10 +550,6 @@ void Screen::initialize(GLFWwindow *window, bool shutdown_glfw) {
549550
);
550551
}
551552
#endif
552-
553-
/// Fixes retina display-related font rendering issue (#185)
554-
nvgBeginFrame(m_nvg_context, m_size[0], m_size[1], m_pixel_ratio);
555-
nvgEndFrame(m_nvg_context);
556553
}
557554

558555
Screen::~Screen() {

0 commit comments

Comments
 (0)