/[xmakemol]/xmakemol/draw.c
ViewVC logotype

Diff of /xmakemol/draw.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.59 by MPHodges, Sun May 11 15:34:49 2003 UTC revision 1.60 by MPHodges, Tue Sep 23 20:17:03 2003 UTC
# Line 58  draw_atom(int si) Line 58  draw_atom(int si)
58        
59    static GC depth_one_gc;    static GC depth_one_gc;
60        
   static Pixmap stipple_pm;  
     
   if(!stipple_pm){  
       
     stipple_pm=XCreatePixmap  
       (display,root_window,2,2,1);  
       
     depth_one_gc=XCreateGC(display,stipple_pm,0,0);  
       
     XSetForeground(display,depth_one_gc,BlackPixelOfScreen(screen_ptr));  
     XFillRectangle(display,stipple_pm,depth_one_gc,0,0,2,2);  
       
     XSetForeground(display,depth_one_gc,WhitePixelOfScreen(screen_ptr));  
     XDrawPoint(display,stipple_pm,depth_one_gc,1,1);  
     XDrawPoint(display,stipple_pm,depth_one_gc,2,2);  
       
     XSetStipple(display,gc,stipple_pm);  
   }  
     
61    radius = get_atom_radius(si);    radius = get_atom_radius(si);
62        
63    gcv.foreground=atoms[si].pixel;    gcv.foreground=atoms[si].pixel;
# Line 106  draw_atom(int si) Line 87  draw_atom(int si)
87         0,         0,
88         360*64);         360*64);
89            
90      if((atoms[si].sel == 1))      if(atoms[si].sel == 1)
91        {        {
         /* stipple */  
         gcv.foreground = BlackPixelOfScreen(screen_ptr);  
         gcv.fill_style = FillStippled;  
         
         XChangeGC(display,  
                   gc,  
                   GCForeground | GCFillStyle,  
                   &gcv);  
         
         XFillArc (display,  
                   canvas_pm,  
                   gc,  
                   (int) (canvas_coord[0] - radius),  
                   (int) (canvas_coord[1] - radius),  
                   (int) (2.0 * radius),  
                   (int) (2.0 * radius),  
                   0,  
                   360*64);  
   
         gcv.fill_style = FillSolid;  
           
         XChangeGC(display,  
                   gc,  
                   GCFillStyle,  
                   &gcv);  
   
92        }        }
93    }    }
94        
95    gcv.fill_style=FillSolid;    if (atoms[si].sel == 1)
96    gcv.foreground=BlackPixelOfScreen(screen_ptr);      {
97          gcv.foreground = sel_color.pixel;
98        }
99      else
100        {
101          gcv.foreground = BlackPixelOfScreen (screen_ptr);
102        }
103    
104    XChangeGC(display,gc,GCFillStyle|GCForeground,&gcv);    XChangeGC (display, gc, GCForeground, &gcv);
105        
106    XDrawArc    XDrawArc
107      (display,      (display,
# Line 218  draw_bond(int si, int sj) Line 179  draw_bond(int si, int sj)
179    gcv.foreground=BlackPixelOfScreen(screen_ptr);    gcv.foreground=BlackPixelOfScreen(screen_ptr);
180    XChangeGC(display,gc,GCForeground,&gcv);    XChangeGC(display,gc,GCForeground,&gcv);
181            
   if(atoms[si].sel){ /* Add stippled overlay */  
     gcv.fill_style=FillStippled;  
     XChangeGC(display,gc,GCFillStyle,&gcv);  
   
     XFillPolygon(display,  
                  canvas_pm,  
                  gc,  
                  bond_points,  
                  4,  
                  Complex,  
                  CoordModeOrigin);  
   
     gcv.fill_style=FillSolid;  
     XChangeGC(display,gc,GCFillStyle,&gcv);  
   }  
       
182    gcv.foreground=atoms[sj].pixel;    gcv.foreground=atoms[sj].pixel;
183    XChangeGC(display,gc,GCForeground,&gcv);    XChangeGC(display,gc,GCForeground,&gcv);
184    
# Line 262  draw_bond(int si, int sj) Line 207  draw_bond(int si, int sj)
207    gcv.foreground=BlackPixelOfScreen(screen_ptr);    gcv.foreground=BlackPixelOfScreen(screen_ptr);
208    XChangeGC(display,gc,GCForeground,&gcv);    XChangeGC(display,gc,GCForeground,&gcv);
209            
   if(atoms[sj].sel){ /* Add stippled overlay */  
     gcv.fill_style=FillStippled;  
     XChangeGC(display,gc,GCFillStyle,&gcv);  
         
     XFillPolygon(display,  
                  canvas_pm,  
                  gc,  
                  bond_points,  
                  4,  
                  Complex,  
                  CoordModeOrigin);  
         
     gcv.fill_style=FillSolid;  
     XChangeGC(display,gc,GCFillStyle,&gcv);  
   }  
   
210    /* Draw the lines 0-2-3-5-0 */    /* Draw the lines 0-2-3-5-0 */
211    
212    bond_points[0].x = canvas_bond_points[0].x;    bond_points[0].x = canvas_bond_points[0].x;

Legend:
Removed from v.1.59  
changed lines
  Added in v.1.60

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26