home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-385-Vol-1of3.iso / g / gina15.zip / demos / gredit / EllipseDrawer. < prev    next >
Text File  |  1992-02-27  |  1KB  |  37 lines

  1. // This may look like C code, but it is really -*- C++ -*-
  2.  
  3. //   Module      : EllipseDrawer.C   Version 1.1
  4. //   LastSCCS    : 2/18/92  15:12:02
  5. //   LastEdit    : "Mon Feb 17 16:44:16 1992"
  6. //   Description : 
  7. //   Author      : 
  8. //   Copyright   : GMD Schloss Birlinghoven
  9.  
  10. EllipseDrawer ::
  11. EllipseDrawer( GnView *view, int x, int y )
  12. : ViewObjectDrawer(view, x, y )
  13. {
  14. }
  15.  
  16. void EllipseDrawer::
  17. create_view_object(int width, int height)
  18. {
  19.     view_object = new GnEllipseO( document->gc_values(), width, height );
  20. }
  21.  
  22. void EllipseDrawer ::
  23. draw_feedback(int x, int y, XBoolean clear )
  24. {
  25.     Gina_Debug( "EllipseDrawer :: draw_feedback " );
  26.     Gina_Debug( MIN(start_x, x) ); Gina_Debug( " " );
  27.     Gina_Debug( MIN(start_y, y) ); Gina_Debug( " " );
  28.     Gina_Debug( ABS(x - start_x) ); Gina_Debug( " " );
  29.     Gina_Debug( ABS(y - start_y) ); Gina_Debug( " " );
  30.     Gina_Debug_NL( clear ? "clear" : "paint" );
  31.     
  32.     XDrawArc(view->get_display(), view->get_x_window(), view->get_feedback_gc(),
  33.          MIN(start_x, x), MIN(start_y, y),
  34.          ABS(x - start_x), ABS(y - start_y), 0, 64*360);
  35. }
  36.  
  37.