From b8e3cd5d64a04a7b6054dd81f92ce2687d6590ab Mon Sep 17 00:00:00 2001 From: Filippo Scognamiglio Date: Fri, 23 Nov 2018 22:35:48 +0100 Subject: [PATCH] Limit screen curvature effect. --- app/qml/ApplicationSettings.qml | 1 + app/qml/PreprocessedTerminal.qml | 2 +- app/qml/ShaderTerminal.qml | 2 +- app/qml/frames/utils/TerminalFrame.qml | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/qml/ApplicationSettings.qml b/app/qml/ApplicationSettings.qml index 3020cb2..d7747fc 100644 --- a/app/qml/ApplicationSettings.qml +++ b/app/qml/ApplicationSettings.qml @@ -30,6 +30,7 @@ QtObject{ // STATIC CONSTANTS //////////////////////////////////////////////////////// + readonly property real screenCurvatureSize: 0.2 readonly property real minimumFontScaling: 0.25 readonly property real maximumFontScaling: 2.50 diff --git a/app/qml/PreprocessedTerminal.qml b/app/qml/PreprocessedTerminal.qml index f92d9f7..2627f8a 100644 --- a/app/qml/PreprocessedTerminal.qml +++ b/app/qml/PreprocessedTerminal.qml @@ -209,7 +209,7 @@ Item{ y = y / height; var cc = Qt.size(0.5 - x, 0.5 - y); - var distortion = (cc.height * cc.height + cc.width * cc.width) * appSettings.screenCurvature; + var distortion = (cc.height * cc.height + cc.width * cc.width) * appSettings.screenCurvature * appSettings.screenCurvatureSize; return Qt.point((x - cc.width * (1+distortion) * distortion) * kterminal.width, (y - cc.height * (1+distortion) * distortion) * kterminal.height) diff --git a/app/qml/ShaderTerminal.qml b/app/qml/ShaderTerminal.qml index 5e5e114..7d6888d 100644 --- a/app/qml/ShaderTerminal.qml +++ b/app/qml/ShaderTerminal.qml @@ -44,7 +44,7 @@ ShaderEffect { property size scaleNoiseSize: Qt.size((width) / (noiseTexture.width * appSettings.windowScaling * appSettings.totalFontScaling), (height) / (noiseTexture.height * appSettings.windowScaling * appSettings.totalFontScaling)) - property real screenCurvature: appSettings.screenCurvature + property real screenCurvature: appSettings.screenCurvature * appSettings.screenCurvatureSize property real glowingLine: appSettings.glowingLine * 0.2 property real chromaColor: appSettings.chromaColor; diff --git a/app/qml/frames/utils/TerminalFrame.qml b/app/qml/frames/utils/TerminalFrame.qml index a708a59..3afb0a2 100644 --- a/app/qml/frames/utils/TerminalFrame.qml +++ b/app/qml/frames/utils/TerminalFrame.qml @@ -105,7 +105,7 @@ Item{ id: staticLight property alias source: framesource property alias normals: framesourcenormals - property real screenCurvature: appSettings.screenCurvature + property real screenCurvature: appSettings.screenCurvature * appSettings.screenCurvatureSize property size curvature_coefficients: Qt.size(width / mainShader.width, height / mainShader.height) property real ambientLight: appSettings.ambientLight * 0.9 + 0.1 property color fontColor: appSettings.fontColor