From 5025509e3a24f455f0f55a8ff4d08fdc36053d74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 19 Feb 2009 11:03:40 +0000 Subject: [PATCH] Distance between 3D windows is determined by the zoom position divided by the number of windows in stacking order when cube is activated. svn path=/trunk/KDE/kdebase/workspace/; revision=928279 --- effects/cube/cube.cpp | 4 +++- effects/cube/cube.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/effects/cube/cube.cpp b/effects/cube/cube.cpp index df397c55f2..0aef763bf3 100644 --- a/effects/cube/cube.cpp +++ b/effects/cube/cube.cpp @@ -86,6 +86,7 @@ CubeEffect::CubeEffect() , useShaders( false ) , cylinderShader( 0 ) , sphereShader( 0 ) + , zOrderingFactor( 0.0f ) , capListCreated( false ) , recompileList( true ) , glList( 0 ) @@ -1410,7 +1411,7 @@ void CubeEffect::paintWindow( EffectWindow* w, int mask, QRegion region, WindowP // z-Ordering if( !w->isDesktop() && !w->isDock() && useZOrdering ) { - float zOrdering = (effects->stackingOrder().indexOf( w )-1)*25.0; + float zOrdering = (effects->stackingOrder().indexOf( w )+1)*zOrderingFactor; if( start ) zOrdering *= timeLine.value(); if( stop ) @@ -1945,6 +1946,7 @@ void CubeEffect::setActive( bool active ) Qt::OpenHandCursor ); frontDesktop = effects->currentDesktop(); zoom = 0.0; + zOrderingFactor = zPosition / ( effects->stackingOrder().count() - 1 ); start = true; effects->setActiveFullScreenEffect( this ); kDebug(1212) << "Cube is activated"; diff --git a/effects/cube/cube.h b/effects/cube/cube.h index bdde251f17..e8da508f9b 100644 --- a/effects/cube/cube.h +++ b/effects/cube/cube.h @@ -144,6 +144,7 @@ class CubeEffect GLShader* sphereShader; float capDeformationFactor; bool useZOrdering; + float zOrderingFactor; // GL lists bool capListCreated;