Server IP : 192.168.23.10  /  Your IP : 216.73.216.184
Web Server : Apache
System : Linux echo.premieradvertising.com 5.14.0-362.8.1.el9_3.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 7 14:54:22 EST 2023 x86_64
User : rrrallyteam ( 1049)
PHP Version : 8.1.32
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF
Directory (0755) :  /home/../usr/share/doc/libasyncns/../perl-Unicode-Normalize/../../../share/graphviz/gvpr/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/../usr/share/doc/libasyncns/../perl-Unicode-Normalize/../../../share/graphviz/gvpr/scalexy
/* finds root node of graph.
 * scales the x and y position of all other nodes using, first,
 * ARGV[0], or $G.scale.
 * 
 * The expected syntax is "x,y" where at least one of x or y must
 * be given. If only one is given, the other is taken as 1.
 */
BEGIN {
  double scalex, scaley;
  int r, done;

  int setScale (char* s) 
  {
    if ((sscanf (s, ",%f",&scaley))) {
        scalex = 1;
        return 1;
    }
    else {
      r = sscanf (s, "%f,%f",&scalex,&scaley);
      if (r) {
        if (r == 1) scaley = 1;
        return 1;
      }
    }
    return 0;
  }

}

BEG_G {
  node_t ctr = node($,aget($,"root"));
  double cx, cy, x, y, delx;
  
  /* get scale argument */
  done = 0;
  if (ARGC == 1)
    done = setScale (ARGV[0]);
  if (!done && isAttr($,"G","scale"))
    done = setScale ($.scale);
  if (!done)
    scalex = scaley = 1.0;

  if ((scalex == 1.0) && (scaley == 1.0))
    exit (0);

  $.bb = "";
  sscanf (ctr.pos, "%f,%f", &cx, &cy);
}
N [$ != ctr] {
    sscanf ($.pos, "%f,%f", &x, &y);
    delx = scalex*(x - cx) + cx;
    dely = scaley*(y - cy) + cy;
    $.pos = sprintf ("%f,%f", delx, dely);
}