~ubuntu-branches/ubuntu/oneiric/cairo-dock-plug-ins/oneiric-updates

« back to all changes in this revision

Viewing changes to dock-rendering/src/rendering-3D-plane.c

  • Committer: Kees Cook
  • Date: 2011-08-11 23:17:39 UTC
  • mfrom: (20.1.1 cairo-dock-plug-ins)
  • Revision ID: kees@outflux.net-20110811231739-cteedan51tmdg77v
Tags: 2.4.0~0beta2-0ubuntu1
releasing version 2.4.0~0beta2-0ubuntu1

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
#define _define_parameters(hi, h0, H, l, r, gamma, h, w, dw)\
40
40
        double hi = myIconsParam.fReflectSize * pDock->container.fRatio + myDocksParam.iFrameMargin;\
41
 
        double h0max = (1 + myIconsParam.fAmplitude) * pDock->iMaxIconHeight/** * pDock->container.fRatio*/ + MAX (myIconsParam.iLabelSize, myDocksParam.iFrameMargin + myDocksParam.iDockLineWidth);\
 
41
        double h0max = (1 + myIconsParam.fAmplitude) * pDock->iMaxIconHeight * pDock->container.fRatio + MAX ((pDock->container.bIsHorizontal || !myIconsParam.bTextAlwaysHorizontal ? myIconsParam.iLabelSize : 0), myDocksParam.iFrameMargin + myDocksParam.iDockLineWidth);\
42
42
        double h0 = pDock->iMaxIconHeight/** * pDock->container.fRatio*/;\
43
43
        double H = iVanishingPointY;\
44
44
        double l = myDocksParam.iDockLineWidth;\
53
53
        
54
54
        _define_parameters (hi, h0, H, l, r, gamma, h, w, dw);
55
55
        pDock->iMaxDockHeight = (int) (hi + h0max + l);
 
56
        
56
57
        // 1ere estimation.
57
58
        // w
58
59
        w = ceil (cairo_dock_calculate_max_dock_width (pDock, pDock->pFirstDrawnElement, pDock->fFlatDockWidth, 1., 2 * dw));  // pDock->iMaxDockWidth
98
99
        pDock->iDecorationsWidth = pDock->iMaxDockWidth;
99
100
        
100
101
        // taille min.
101
 
        pDock->iMinDockHeight = myDocksParam.iDockLineWidth + myDocksParam.iFrameMargin + myIconsParam.fReflectSize * pDock->container.fRatio + pDock->iMaxIconHeight * pDock->container.fRatio;
 
102
        double fRatio = (pDock->iRefCount == 0 && pDock->iVisibility == CAIRO_DOCK_VISI_RESERVE ? 1. : pDock->container.fRatio);  // prevent the dock from resizing itself and all the maximized windows each time an icon is removed/inserted.
 
103
        pDock->iMinDockHeight = myDocksParam.iDockLineWidth + myDocksParam.iFrameMargin + myIconsParam.fReflectSize * fRatio + pDock->iMaxIconHeight * fRatio;
102
104
        
103
105
        double gamma_min = pDock->fFlatDockWidth / 2 / H;
104
106
        double dw_min = h * gamma_min + r + (l+(r==0)*2)*sqrt(1+gamma_min*gamma_min);
117
119
        }
118
120
        
119
121
        pDock->iMinDockWidth = MAX (1, pDock->fFlatDockWidth);  // fFlatDockWidth peut etre meme negatif avec un dock vide.
 
122
        
 
123
        pDock->iActiveWidth = pDock->iMaxDockWidth;
 
124
        pDock->iActiveHeight = pDock->iMaxDockHeight;
 
125
        if (! pDock->container.bIsHorizontal && myIconsParam.bTextAlwaysHorizontal)
 
126
                pDock->iMaxDockHeight += 6*myIconsParam.iLabelSize;  // vertical dock, add some padding to draw the labels.     
120
127
}
121
128
 
122
129
static void cd_rendering_calculate_construction_parameters_3D_plane (Icon *icon, int iWidth, int iHeight, int iMaxDockWidth, double fReflectionOffsetY)