void
reserveStruts (CompRect &workArea)
{
    workArea.setLeft (workArea.left () + 24);
    workArea.setTop (workArea.top () + 24);
    workArea.setBottom (workArea.bottom () - 24);
}
示例#2
0
	void
	calculateWallOffset (const CompRect  &output,
			     const CompPoint &offsetInScreenCoords,
			     const CompPoint &vpSize,
			     const CompSize  &screenSize,
			     float           &offsetInWorldX,
			     float           &offsetInWorldY,
			     float	     &worldScaleFactorX,
			     float	     &worldScaleFactorY,
			     float           animationProgress)
	{
	    const float sx = screenSize.width () / static_cast <float> (output.width ());
	    const float sy = screenSize.height () / static_cast <float> (output.height ());
	    offsetInWorldX = 0.0;
	    offsetInWorldY = 0.0;
	    worldScaleFactorX = 1.0f;
	    worldScaleFactorY = 1.0f;

	    if (output.left () == 0)
	    {
		offsetInWorldX = ((vpSize.x () * sx) / ((float) output.width ()) * (offsetInScreenCoords.x ()) * animationProgress);
		worldScaleFactorX = 1.0f - ((float) (offsetInScreenCoords.x ()) / (float) (output.width ())) * animationProgress;
	    }

	    if (output.top () == 0)
	    {
		offsetInWorldY = ((vpSize.y () * sy) / ((float) output.height ()) * (offsetInScreenCoords.y ()) * animationProgress);
		worldScaleFactorY = 1.0f - ((float) (offsetInScreenCoords.y ()) / (float) output.height ()) * animationProgress;
	    }
	}