]> granicus.if.org Git - graphviz/commitdiff
Allow empty string to be treated as default; needed for visible
authorerg <devnull@localhost>
Wed, 17 Mar 2010 19:09:26 +0000 (19:09 +0000)
committererg <devnull@localhost>
Wed, 17 Mar 2010 19:09:26 +0000 (19:09 +0000)
cmd/smyrna/smyrna_utils.c
cmd/smyrna/smyrna_utils.h
cmd/smyrna/topviewfuncs.c

index 2dd0963f6dfac11ee165519f1cbef3cc00b445dc..0d43ef214f4ee8d9b0e59ce0ee232bdda0ac50b8 100644 (file)
@@ -110,6 +110,18 @@ int getAttrBool(Agraph_t* g,void* obj,char* attr_name,int def)
     attr = agattr(g, AGTYPE(obj), attr_name,0);
     return late_bool(obj, attr,def);
 }
+/* Differs from getAttrBool in that a value of "" returns def */
+int getAttrBool1(Agraph_t* g,void* obj,char* attr_name,int def)
+{
+    Agsym_t* attr;
+    char* s;
+    if ((attr = agattr(g, AGTYPE(obj), attr_name,0))) {
+       s = agxget (obj, attr);
+       if (*s) return mapbool(s);
+       else return def;
+    }
+    else return def;
+}
 int getAttrInt(Agraph_t* g,void* obj,char* attr_name,int def)
 {
     Agsym_t* attr;
index 83ad72dcf01797b5b584907480b113e175af0793..1b37f5f2ce131dce091936d7de090c434817fccd 100644 (file)
@@ -22,6 +22,7 @@
 extern int l_int(void *obj, Agsym_t * attr, int def);
 extern float l_float(void *obj, Agsym_t * attr, float def);
 extern int getAttrBool(Agraph_t* g,void* obj,char* attr_name,int def);
+extern int getAttrBool1(Agraph_t* g,void* obj,char* attr_name,int def);
 extern int getAttrInt(Agraph_t* g,void* obj,char* attr_name,int def);
 extern float getAttrFloat(Agraph_t* g,void* obj,char* attr_name,float def);
 extern char* getAttrStr(Agraph_t* g,void* obj,char* attr_name,char* def);
index dd9db8c73c8e834951a03c7c694d5d607d8624d6..ef774a8cb2b8939989224737ddb8a42e04660084 100644 (file)
@@ -159,9 +159,10 @@ int object_color(void* obj,glCompColor* c)
        Alpha=getAttrFloat(g,agraphof(obj),"defaultedgealpha",1);
     if(objType==AGNODE)
        Alpha=getAttrFloat(g,agraphof(obj),"defaultnodealpha",1);
-    if(!getAttrBool(g,obj,"visible",1))
+    if(!getAttrBool1(g,obj,"visible",1))
        return 0;
     /*get edge's color attribute */
+    setColorScheme (agget (obj, "colorscheme"));
     bf=getAttrStr(g,obj,"color",NULL);
     if((bf)&&(strlen(bf)>0))
     {
@@ -753,6 +754,7 @@ void initSmGraph(Agraph_t * g,topview* rv)
 void renderSmGraph(Agraph_t * g,topview* t)
 {
 
+    glEnable(GL_POINT_SMOOTH);
 
     if(view->drawnodes)
     {