1
0
mirror of https://github.com/Swordfish90/cool-retro-term.git synced 2025-02-21 04:19:00 +00:00

Use scale transformation instead of shadereffectsource. Faster when reducing quality.

This commit is contained in:
Filippo Scognamiglio 2014-12-11 01:20:51 +01:00
parent b9f2cc4300
commit dcb332b06f
2 changed files with 9 additions and 22 deletions

View File

@ -28,10 +28,10 @@ Item{
id: terminalContainer
//Frame displacement properties. This makes the terminal the same size of the texture.
property real dtop: frame.item.displacementTop
property real dleft:frame.item.displacementLeft
property real dright: frame.item.displacementRight
property real dbottom: frame.item.displacementBottom
property real dtop: frame.item.displacementTop * shadersettings.window_scaling
property real dleft:frame.item.displacementLeft * shadersettings.window_scaling
property real dright: frame.item.displacementRight * shadersettings.window_scaling
property real dbottom: frame.item.displacementBottom * shadersettings.window_scaling
property alias title: ksession.title
@ -175,8 +175,8 @@ Item{
MouseArea{
acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton
// This is incredibly ugly. All this file should be reorganized.
width: (parent.width + dleft + dright) / shadersettings.window_scaling - dleft -dright
height: (parent.height + dtop + dbottom) / shadersettings.window_scaling - dtop - dbottom
width: (parent.width + dleft + dright) - dleft -dright
height: (parent.height + dtop + dbottom) - dtop - dbottom
onWheel:{
if(wheel.modifiers & Qt.ControlModifier){
wheel.angleDelta.y > 0 ? zoomIn.trigger() : zoomOut.trigger();

View File

@ -24,23 +24,10 @@ Item{
opacity: shadersettings.windowOpacity * 0.3 + 0.7
z: 1.9
}
}
// This is used to render the texture to a lower resolution then scale it up.
Loader{
id: scalableContentSource
active: shadersettings.window_scaling < 1
sourceComponent: ShaderEffectSource{
sourceItem: scalableContent
hideSource: true
smooth: true
}
}
Loader{
active: shadersettings.window_scaling < 1
anchors.fill: parent
sourceComponent: ShaderEffect{
property var source: scalableContentSource.item
transform: Scale {
xScale: 1 / shadersettings.window_scaling
yScale: 1 / shadersettings.window_scaling
}
}