Fix rendering on non HiDPI screens

This commit is contained in:
Cameron Armstrong (Nightfox)
2021-03-28 09:05:36 +08:00
parent dac2b4ff16
commit 08b217ab5f
5 changed files with 14 additions and 9 deletions
+3 -3
View File
@@ -71,7 +71,7 @@ Item{
QMLTermWidget {
id: kterminal
property int textureResolutionScale: appSettings.lowResolutionFont ? devicePixelRatio : 1
property int textureResolutionScale: appSettings.lowResolutionFont ? appSettings.pixelRatio : 1
property int margin: appSettings.margin / screenScaling
property int totalWidth: Math.floor(parent.width / (screenScaling * fontWidth))
property int totalHeight: Math.floor(parent.height / screenScaling)
@@ -81,8 +81,8 @@ Item{
textureSize: Qt.size(width / textureResolutionScale, height / textureResolutionScale)
width: ensureMultiple(rawWidth, devicePixelRatio)
height: ensureMultiple(rawHeight, devicePixelRatio)
width: ensureMultiple(rawWidth, appSettings.pixelRatio)
height: ensureMultiple(rawHeight, appSettings.pixelRatio)
/** Ensure size is a multiple of factor. This is needed for pixel perfect scaling on highdpi screens. */
function ensureMultiple(size, factor) {