1
0
mirror of https://github.com/Swordfish90/cool-retro-term.git synced 2025-03-20 09:39:07 +00:00

Fix scanlines on high-dpi screens.

This commit is contained in:
Filippo Scognamiglio 2015-01-20 03:35:47 +01:00
parent 2911960482
commit 546c4f36f0
2 changed files with 4 additions and 2 deletions

View File

@ -72,6 +72,8 @@ int main(int argc, char *argv[])
engine.rootContext()->setContextProperty("workdir", getNamedArgument(args, "--workdir", "$HOME"));
engine.rootContext()->setContextProperty("fileIO", &fileIO);
engine.rootContext()->setContextProperty("devicePixelRatio", app.devicePixelRatio());
// Manage import paths for Linux and OSX.
QStringList importPathList = engine.importPathList();
importPathList.prepend(QCoreApplication::applicationDirPath() + "/qmltermwidget");

View File

@ -61,8 +61,8 @@ ShaderEffect {
// This is the average value of the abs(sin) function. Needed to avoid aliasing.
readonly property real absSinAvg: 0.63661828335466886
property size rasterizationSmooth: Qt.size(
Utils.clamp(2.0 * virtual_resolution.width / width, 0.0, 1.0),
Utils.clamp(2.0 * virtual_resolution.height / height, 0.0, 1.0))
Utils.clamp(2.0 * virtual_resolution.width / (width * devicePixelRatio), 0.0, 1.0),
Utils.clamp(2.0 * virtual_resolution.height / (height * devicePixelRatio), 0.0, 1.0))
property real dispX
property real dispY