diff --git a/Libraries/nanovg b/Libraries/nanovg index 00fdfc976..f444a5a5f 160000 --- a/Libraries/nanovg +++ b/Libraries/nanovg @@ -1 +1 @@ -Subproject commit 00fdfc97665db5acdd9c859e02a6b792761d88c8 +Subproject commit f444a5a5f878696ad72b5017e72f342f2a110a48 diff --git a/Libraries/pd-lua b/Libraries/pd-lua index 2bd1efb69..e987fafd5 160000 --- a/Libraries/pd-lua +++ b/Libraries/pd-lua @@ -1 +1 @@ -Subproject commit 2bd1efb69532cca3dc7a7e2b465adf4e8ce2c695 +Subproject commit e987fafd5ad2f87a4f3c606cc43cc3960543b61f diff --git a/Source/NVGSurface.cpp b/Source/NVGSurface.cpp index ee6d2709d..01eec4c60 100644 --- a/Source/NVGSurface.cpp +++ b/Source/NVGSurface.cpp @@ -127,7 +127,7 @@ void NVGSurface::initialise() setVisible(true); lastRenderScale = calculateRenderScale(); - nvg = nvgCreateContext(view, NVG_ANTIALIAS | NVG_TRIPLE_BUFFER, getWidth() * lastRenderScale, getHeight() * lastRenderScale); + nvg = nvgCreateContext(view, NVG_TRIPLE_BUFFER, getWidth() * lastRenderScale, getHeight() * lastRenderScale); #else setVisible(true); glContext->attachTo(*this); @@ -155,6 +155,8 @@ void NVGSurface::initialise() updateWindowContextVisibility(); surfaces[nvg] = this; + + nvgAtlasTextThreshold(nvg, 48.0f); nvgCreateFontMem(nvg, "Inter", (unsigned char*)BinaryData::InterRegular_ttf, BinaryData::InterRegular_ttfSize, 0); nvgCreateFontMem(nvg, "Inter-Regular", (unsigned char*)BinaryData::InterRegular_ttf, BinaryData::InterRegular_ttfSize, 0); nvgCreateFontMem(nvg, "Inter-Bold", (unsigned char*)BinaryData::InterBold_ttf, BinaryData::InterBold_ttfSize, 0); diff --git a/Source/Objects/LuaObject.h b/Source/Objects/LuaObject.h index b56eed551..3011544c9 100644 --- a/Source/Objects/LuaObject.h +++ b/Source/Objects/LuaObject.h @@ -235,8 +235,14 @@ class LuaObject final : public ObjectBase void render(NVGcontext* nvg) override { + NVGScopedState scopedState(nvg); + + auto scale = nvgCurrentPixelScale(nvg) * getValue(zoomScale); + nvgScale(nvg, 1.0f / scale, 1.0f / scale); + nvgTransformQuantize(nvg); + for (auto& [layer, fb] : framebuffers) { - fb.render(nvg, Rectangle(getWidth() + 1, getHeight())); + fb.render(nvg, Rectangle(std::ceil(getWidth() * scale), std::ceil(getHeight() * scale))); } }