]> granicus.if.org Git - graphviz/commitdiff
*** empty log message ***
authorarif <devnull@localhost>
Fri, 24 Oct 2008 22:05:06 +0000 (22:05 +0000)
committerarif <devnull@localhost>
Fri, 24 Oct 2008 22:05:06 +0000 (22:05 +0000)
cmd/smyrna/draw.c
cmd/smyrna/gltemplate.c
cmd/smyrna/main.c
cmd/smyrna/smyrnadefs.h
cmd/smyrna/topview.c

index e2bc514e68d9a1a4faa860fca3f5bafe62603e3a..02b2d5e0bf5df80f959825d18eead89115411fac 100755 (executable)
@@ -785,33 +785,34 @@ int draw_node_hintbox_gl_polygon(GLfloat x,GLfloat y,GLfloat z,GLfloat fs,char*
 
 {
 
+
        float X,Y,Z,pad;
        pad=fs/5.0;
-       X=x;Y=y+fs;Z=z;
+       X=x;Y=y;Z=z+0.0005;
        glBegin(GL_POLYGON);
-       //rectangle
        glVertex3f(X,Y,Z);
-       Y=Y + 2*fs+2*pad;
+       Y=Y + fs;
        glVertex3f(X,Y,Z);
-       X=X+2*pad+strlen(text)*fs;
+       X=X+fs;
        glVertex3f(X,Y,Z);
-       Y=y+fs;
+       X=x;y=y;
        glVertex3f(X,Y,Z);
-       X=x;
-       glVertex3f(X,Y,Z);
-       //triangle
        glEnd();
-       X=x;Y=y;
+
+       X=x;Y=y+fs;
        glBegin(GL_POLYGON);
        glVertex3f(X,Y,Z);
-       Y=Y + fs;
+       X=x;Y=Y+fs+2*pad;
        glVertex3f(X,Y,Z);
-       X=X+2*pad;
+       X=x+strlen(text)*fs/2.0+2.0*pad;
        glVertex3f(X,Y,Z);
-       X=x;Y=y;
+       Y=y+fs;
+       glVertex3f(X,Y,Z);
+       X=x;
        glVertex3f(X,Y,Z);
        glEnd();
 
+
        return 1;
 
 }
@@ -826,7 +827,7 @@ int draw_node_hintbox_gl_line(GLfloat x,GLfloat y,GLfloat z,GLfloat fs,char* tex
        glVertex3f(X,Y,Z);
        Y=Y + 2*fs+2*pad;
        glVertex3f(X,Y,Z);
-       X=X+2*pad+strlen(text)*fs;
+       X=X+2*pad+strlen(text)*fs/2.0;
        glVertex3f(X,Y,Z);
        Y=y+fs;
        glVertex3f(X,Y,Z);
index 01d5f57279b4efe09ebcfdceb2e253ce5f73ee81..ba187ed1a60826d44c91b482049b4738667b81bb 100755 (executable)
@@ -132,7 +132,7 @@ static void realize(GtkWidget * widget, gpointer data)
     static char *smyrna_font;
 
 #ifdef WIN32
-    smyrna_font = "c:/arial.tga";
+    smyrna_font = "c:/pango_font.tga";
 #else
     smyrna_font = smyrnaPath("arial.tga");
 #endif
@@ -290,7 +290,9 @@ static gboolean button_press_event(GtkWidget * widget,
 static gboolean button_release_event(GtkWidget * widget,
                                     GdkEventButton * event, gpointer data)
 {
-    if (event->button == 1)    //left click release
+       view->FontSizeConst=GetOGLDistance(14);
+
+       if (event->button == 1) //left click release
     {
                if (glCompSetRelease
            (view->Topview->topviewmenu, (int) event->x_root,
@@ -396,7 +398,6 @@ static gboolean motion_notify_event(GtkWidget * widget,
     if ((event->state & GDK_BUTTON1_MASK)
        && (view->mouse.mouse_mode == MM_ZOOM))
        {
-               view->FontSizeConst=GetOGLDistance(14);
 
                if (glmotion_main(view, event, widget))
                    redraw = TRUE;
index 3c0de828e4e15dbf51325965efefdc7cd8be18b9..9d346426b58de5f43de3db3c4733434f4b61b764 100755 (executable)
@@ -103,6 +103,8 @@ parseArgs (int argc, char *argv[], ViewInfo* view)
     else
        return NULL;
 }
+extern int create_font_file(char* fontdescription,float gw,float gh);
+extern int load_png_font(char* file_name);
 
 int main(int argc, char *argv[])
 {
@@ -115,7 +117,8 @@ int main(int argc, char *argv[])
        smyrnaDir = SMYRNA_PATH;
 #endif
 
-    load_attributes();
+//     create_font_file("c:\\pango_test.png",(float)64.0,(float)64.0);
+       load_attributes();
 
 #ifdef G_OS_WIN32
     package_prefix =
index 7e06d70fb5058cba35a925e55486d6cb3cbe02d8..3f1dbeaf0d8dcf459da8f2b4d763b44a7a0a8e90 100644 (file)
@@ -493,7 +493,7 @@ typedef struct _ViewInfo
        viewtype_t dfltViewType;
        gvk_layout dfltEngine;
        GtkTextBuffer* consoleText;
-       int FontSizeConst;
+       float FontSizeConst;
 } ViewInfo;
 
 extern ViewInfo *view;
index 86229cc9f5ab224aaa9b8004247b22c2112d00b7..593d1f2404b5ca72f9af102162675ac0c2515487 100755 (executable)
@@ -617,10 +617,12 @@ static int pick_node(topview_node * n)
 static int draw_node_hint_boxes()
 {
     int ind;
-    int fs = 12;
-    for (ind = 0; ind < view->Topview->picked_node_count; ind++) {
+       char buf[512];
+       float fs = view->FontSizeConst;
+       strcpy(buf,"line 1:12334444 \n line 2:falan filan");
+       for (ind = 0; ind < view->Topview->picked_node_count; ind++) {
 //     int draw_node_hintbox(GLfloat x,GLfloat y,GLfloat z,GLfloat fs,char* text)
-       draw_node_hintbox(view->Topview->picked_nodes[ind]->distorted_x,
+               draw_node_hintbox(view->Topview->picked_nodes[ind]->distorted_x,
                          view->Topview->picked_nodes[ind]->distorted_y,
                                view->Topview->picked_nodes[ind]->distorted_z,
                          (GLfloat) fs,agnameof(view->Topview->picked_nodes[ind]->Node)
@@ -628,16 +630,17 @@ static int draw_node_hint_boxes()
                          ;
        fontSize(fs);
        fontColorA(0, 0, 1, 1);
-       fontDrawString((int)
-                      (view->Topview->picked_nodes[ind]->distorted_x -
-                       fs / 3 + 1 - fs),
-                      (int) (view->Topview->picked_nodes[ind]->
-                             distorted_y + fs + 1),
+
+
+       fontDrawString(
+                      (view->Topview->picked_nodes[ind]->distorted_x),
+                       (view->Topview->picked_nodes[ind]->
+                             distorted_y+fs+fs/5.0 ),
                       agnameof(view->Topview->picked_nodes[ind]->Node),
                       fs *
-                      strlen(agnameof
+                      (float)strlen(agnameof
                              (view->Topview->picked_nodes[ind]->Node)) /
-                      2);
+                      2.0);
     }
     return 1;
 }