Enlightenment CVS committal

Author  : raster
Project : e17
Module  : libs/edje

Dir     : e17/libs/edje/src/lib


Modified Files:
        edje_calc.c 


Log Message:


oops - fix alignment just a little

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/lib/edje_calc.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -3 -r1.33 -r1.34
--- edje_calc.c 24 May 2004 08:30:30 -0000      1.33
+++ edje_calc.c 5 Jul 2004 10:59:37 -0000       1.34
@@ -373,10 +373,12 @@
    if (params->h > 0)
      {
        double aspect;
-       double new_w, new_h;
+       double new_w, new_h, want_x, want_y, want_w, want_h;
    
-       new_h = params->h;
-       new_w = params->w;
+       want_x = params->x;
+       want_y = params->y;
+       want_h = new_h = params->h;
+       want_w = new_w = params->w;
        aspect = (double)params->w / (double)params->h;
        if (desc->aspect.prefer == EDJE_ASPECT_PREFER_NONE) /* keep both dimensions in 
check */
          {
@@ -415,41 +417,23 @@
        if ((params->h - new_h) > (params->w - new_w))
          {
             if (params->h < new_h)
-              {
-                 params->y = params->y +
-                   ((params->h - new_h) * (1.0 - desc->align.y));
-                 params->h = new_h;
-              }
+              params->h = new_h;
             else if (params->h > new_h)
-              {
-                 params->y = params->y +
-                   ((params->h - new_h) * desc->align.y);
-                 params->h = new_h;
-              }
+              params->h = new_h;
             if (desc->aspect.prefer == EDJE_ASPECT_PREFER_VERTICAL)
-              {
-                 params->w = new_w;
-              }
+              params->w = new_w;
          }
        else
          {
             if (params->w < new_w)
-              {
-                 params->x = params->x +
-                   ((params->w - new_w) * (1.0 - desc->align.x));
-                 params->w = new_w;
-              }
+              params->w = new_w;
             else if (params->w > new_w)
-              {
-                 params->x = params->x +
-                   ((params->w - new_w) * desc->align.x);
-                 params->w = new_w;
-              }
+              params->w = new_w;
             if (desc->aspect.prefer == EDJE_ASPECT_PREFER_HORIZONTAL)
-              {
-                 params->h = new_h;
-              }
+              params->h = new_h;
          }
+       params->x = want_x + ((want_w - params->w) * desc->align.x);
+       params->y = want_y + ((want_h - params->h) * desc->align.y);
      }
 #endif
    




-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to