commit dc47cb49fee3c597ec3e2fb80e8f2c80b730838d
parent a93b12cb0a37dd17ef5358d5fed4b361091b8e84
Author: falkTX <falktx@falktx.com>
Date: Sat, 3 Jul 2021 23:58:29 +0100
Auto-scale NanoVG by widget scale factor
Signed-off-by: falkTX <falktx@falktx.com>
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/dgl/src/NanoVG.cpp b/dgl/src/NanoVG.cpp
@@ -287,7 +287,10 @@ void NanoVG::beginFrame(Widget* const widget)
return;
if (TopLevelWidget* const tlw = widget->getTopLevelWidget())
- nvgBeginFrame(fContext, static_cast<int>(tlw->getWidth()), static_cast<int>(tlw->getHeight()), 1.0f);
+ nvgBeginFrame(fContext,
+ static_cast<int>(tlw->getWidth()),
+ static_cast<int>(tlw->getHeight()),
+ tlw->getScaleFactor());
}
void NanoVG::cancelFrame()