Index: FL/Fl_Graphics_Driver.H
===================================================================
--- FL/Fl_Graphics_Driver.H	(revision 12247)
+++ FL/Fl_Graphics_Driver.H	(working copy)
@@ -434,14 +434,10 @@
   virtual void xyline(int x, int y, int x1, int y2);
   virtual void xyline(int x, int y, int x1, int y2, int x3);
   virtual void xyline_unscaled(float x, float y, float x1)=0;
-  virtual void xyline_unscaled(float x, float y, float x1, float y2)=0;
-  virtual void xyline_unscaled(float x, float y, float x1, float y2, float x3)=0;
   virtual void yxline(int x, int y, int y1);
   virtual void yxline(int x, int y, int y1, int x2);
   virtual void yxline(int x, int y, int y1, int x2, int y3);
   virtual void yxline_unscaled(float x, float y, float y1)=0;
-  virtual void yxline_unscaled(float x, float y, float y1, float x2)=0;
-  virtual void yxline_unscaled(float x, float y, float y1, float x2, float y3)=0;
   virtual void loop(int x0, int y0, int x1, int y1, int x2, int y2);
   virtual void loop_unscaled(float x0, float y0, float x1, float y1, float x2, float y2)=0;
   virtual void loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3);
Index: documentation/Doxyfile.in
===================================================================
--- documentation/Doxyfile.in	(revision 12247)
+++ documentation/Doxyfile.in	(working copy)
@@ -611,8 +611,13 @@
 # excluded from the INPUT source files. This way you can easily exclude a
 # subdirectory from a directory tree whose root is specified with the INPUT tag.
 
-EXCLUDE  = @CMAKE_SOURCE_DIR@/src/aimm.h
-EXCLUDE += @CMAKE_SOURCE_DIR@/src/drivers/
+EXCLUDE  = @CMAKE_SOURCE_DIR@/src/drivers/
+EXCLUDE += @CMAKE_SOURCE_DIR@/src/fl_font_win32.cxx
+EXCLUDE += @CMAKE_SOURCE_DIR@/src/fl_dnd_win32.cxx
+EXCLUDE += @CMAKE_SOURCE_DIR@/src/Fl_get_key_win32.cxx
+EXCLUDE += @CMAKE_SOURCE_DIR@/src/fl_font_mac.cxx
+EXCLUDE += @CMAKE_SOURCE_DIR@/src/Fl_get_key_mac.cxx
+EXCLUDE += @CMAKE_SOURCE_DIR@/src/fl_dnd_x.cxx
 
 # The EXCLUDE_SYMLINKS tag can be used select whether or not files or
 # directories that are symbolic links (a Unix filesystem feature) are excluded
Index: src/Fl_Graphics_Driver.cxx
===================================================================
--- src/Fl_Graphics_Driver.cxx	(revision 12254)
+++ src/Fl_Graphics_Driver.cxx	(working copy)
@@ -191,7 +191,14 @@
 
 void Fl_Scalable_Graphics_Driver::rect(int x, int y, int w, int h)
 {
-  rect_unscaled(x * scale_, y * scale_, w * scale_, h * scale_);
+  if (int(scale_) == scale_) {
+    rect_unscaled(x * scale_, y * scale_, w * scale_, h * scale_);
+  } else {
+    xyline(x, y, x+w-1);
+    yxline(x, y, y+h-1);
+    yxline(x+w-1, y, y+h-1);
+    xyline(x, y+h-1, x+w-1);
+  }
 }
 
 void Fl_Scalable_Graphics_Driver::rectf(int x, int y, int w, int h)
@@ -204,31 +211,46 @@
 }
 
 void Fl_Scalable_Graphics_Driver::line(int x, int y, int x1, int y1) {
-  line_unscaled( x*scale_, y*scale_, x1*scale_, y1*scale_);
+  if (y == y1) xyline(x, y, x1);
+  else if (x == x1) yxline(x, y, y1);
+  else line_unscaled( x*scale_, y*scale_, x1*scale_, y1*scale_);
 }
 
 void Fl_Scalable_Graphics_Driver::line(int x, int y, int x1, int y1, int x2, int y2) {
-  line_unscaled( x*scale_, y*scale_, x1*scale_, y1*scale_, x2*scale_, y2*scale_);
+  if ( (y == y1 || x == x1) && (y2 == y1 || x2 == x1) ) { // only horizontal or vertical lines
+    line(x, y, x1, y1);
+    line(x1, y1, x2, y2);
+  } else line_unscaled( x*scale_, y*scale_, x1*scale_, y1*scale_, x2*scale_, y2*scale_);
 }
 
 void Fl_Scalable_Graphics_Driver::xyline(int x, int y, int x1) {
   xyline_unscaled(x*scale_, y*scale_, x1*scale_);
 }
+
 void Fl_Scalable_Graphics_Driver::xyline(int x, int y, int x1, int y2) {
-  xyline_unscaled(x*scale_, y*scale_, x1*scale_, y2*scale_);
+  xyline(x, y, x1);
+  yxline(x1, y, y2);
 }
+
 void Fl_Scalable_Graphics_Driver::xyline(int x, int y, int x1, int y2, int x3) {
-  xyline_unscaled(x*scale_, y*scale_, x1*scale_, y2*scale_, x3*scale_);
+  xyline(x, y, x1);
+  yxline(x1, y, y2);
+  xyline(x1, y2, x3);
 }
 
 void Fl_Scalable_Graphics_Driver::yxline(int x, int y, int y1) {
   yxline_unscaled(x*scale_, y*scale_, y1*scale_);
 }
+
 void Fl_Scalable_Graphics_Driver::yxline(int x, int y, int y1, int x2) {
-  yxline_unscaled(x*scale_, y*scale_, y1*scale_, x2*scale_);
+  yxline(x, y, y1);
+  xyline(x, y1, x2);
 }
+
 void Fl_Scalable_Graphics_Driver::yxline(int x, int y, int y1, int x2, int y3) {
-  yxline_unscaled(x*scale_, y*scale_, y1*scale_, x2*scale_, y3*scale_);
+  yxline(x, y, y1);
+  xyline(x, y1, x2);
+  yxline(x2, y1, y3);
 }
 
 void Fl_Scalable_Graphics_Driver::loop(int x0, int y0, int x1, int y1, int x2, int y2) {
@@ -236,7 +258,15 @@
 }
 
 void Fl_Scalable_Graphics_Driver::loop(int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3) {
-  loop_unscaled(x0*scale_, y0*scale_, x1*scale_, y1*scale_, x2*scale_, y2*scale_, x3*scale_, y3*scale_);
+  if ( (x0==x1 || y0==y1) && (x2==x1 || y2==y1) && (x2==x3 || y2==y3) && (x0==x3 || y0==y3) ) {
+    // only horizontal and vertical lines
+    line(x0, y0, x1, y1);
+    line(x1, y1, x2, y2);
+    line(x2, y2, x3, y3);
+    line(x3, y3, x0, y0);
+  } else {
+    loop_unscaled(x0*scale_, y0*scale_, x1*scale_, y1*scale_, x2*scale_, y2*scale_, x3*scale_, y3*scale_);
+  }
 }
 
 void Fl_Scalable_Graphics_Driver::polygon(int x0, int y0, int x1, int y1, int x2, int y2) {
Index: src/drivers/GDI/Fl_GDI_Graphics_Driver.H
===================================================================
--- src/drivers/GDI/Fl_GDI_Graphics_Driver.H	(revision 12247)
+++ src/drivers/GDI/Fl_GDI_Graphics_Driver.H	(working copy)
@@ -103,11 +103,7 @@
   virtual void line_unscaled(float x, float y, float x1, float y1);
   virtual void line_unscaled(float x, float y, float x1, float y1, float x2, float y2);
   virtual void xyline_unscaled(float x, float y, float x1);
-  virtual void xyline_unscaled(float x, float y, float x1, float y2);
-  virtual void xyline_unscaled(float x, float y, float x1, float y2, float x3);
   virtual void yxline_unscaled(float x, float y, float y1);
-  virtual void yxline_unscaled(float x, float y, float y1, float x2);
-  virtual void yxline_unscaled(float x, float y, float y1, float x2, float y3);
   virtual void loop_unscaled(float x0, float y0, float x1, float y1, float x2, float y2);
   virtual void loop_unscaled(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3);
   virtual void polygon_unscaled(float x0, float y0, float x1, float y1, float x2, float y2);
Index: src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx
===================================================================
--- src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx	(revision 12247)
+++ src/drivers/GDI/Fl_GDI_Graphics_Driver_rect.cxx	(working copy)
@@ -84,23 +84,6 @@
   MoveToEx(gc_, x, y, 0L); LineTo(gc_, x1+1, y);
 }
 
-void Fl_GDI_Graphics_Driver::xyline_unscaled(float x, float y, float x1, float y2) {
-  if (y2 < y) y2--;
-  else y2++;
-  MoveToEx(gc_, x, y, 0L);
-  LineTo(gc_, x1, y);
-  LineTo(gc_, x1, y2);
-}
-
-void Fl_GDI_Graphics_Driver::xyline_unscaled(float x, float y, float x1, float y2, float x3) {
-  if(x3 < x1) x3--;
-  else x3++;
-  MoveToEx(gc_, x, y, 0L);
-  LineTo(gc_, x1, y);
-  LineTo(gc_, x1, y2);
-  LineTo(gc_, x3, y2);
-}
-
 void Fl_GDI_Graphics_Driver::yxline_unscaled(float x, float y, float y1) {
   if (y1 < y) y1--;
   else y1++;
@@ -107,23 +90,6 @@
   MoveToEx(gc_, x, y, 0L); LineTo(gc_, x, y1);
 }
 
-void Fl_GDI_Graphics_Driver::yxline_unscaled(float x, float y, float y1, float x2) {
-  if (x2 > x) x2++;
-  else x2--;
-  MoveToEx(gc_, x, y, 0L);
-  LineTo(gc_, x, y1);
-  LineTo(gc_, x2, y1);
-}
-
-void Fl_GDI_Graphics_Driver::yxline_unscaled(float x, float y, float y1, float x2, float y3) {
-  if(y3<y1) y3--;
-  else y3++;
-  MoveToEx(gc_, x, y, 0L);
-  LineTo(gc_, x, y1);
-  LineTo(gc_, x2, y1);
-  LineTo(gc_, x2, y3);
-}
-
 void Fl_GDI_Graphics_Driver::loop_unscaled(float x, float y, float x1, float y1, float x2, float y2) {
   MoveToEx(gc_, x, y, 0L);
   LineTo(gc_, x1, y1);
Index: src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H
===================================================================
--- src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H	(revision 12247)
+++ src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H	(working copy)
@@ -145,11 +145,7 @@
   virtual void line_unscaled(float x, float y, float x1, float y1);
   virtual void line_unscaled(float x, float y, float x1, float y1, float x2, float y2);
   virtual void xyline_unscaled(float x, float y, float x1);
-  virtual void xyline_unscaled(float x, float y, float x1, float y2);
-  virtual void xyline_unscaled(float x, float y, float x1, float y2, float x3);
   virtual void yxline_unscaled(float x, float y, float y1);
-  virtual void yxline_unscaled(float x, float y, float y1, float x2);
-  virtual void yxline_unscaled(float x, float y, float y1, float x2, float y3);
   virtual void loop_unscaled(float x0, float y0, float x1, float y1, float x2, float y2);
   virtual void loop_unscaled(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3);
   virtual void polygon_unscaled(float x0, float y0, float x1, float y1, float x2, float y2);
Index: src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx
===================================================================
--- src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx	(revision 12254)
+++ src/drivers/Xlib/Fl_Xlib_Graphics_Driver_rect.cxx	(working copy)
@@ -163,14 +163,14 @@
 
 // --- line and polygon drawing
 
-
+// called only when scale_ has integer value
 void Fl_Xlib_Graphics_Driver::rect_unscaled(float fx, float fy, float fw, float fh) {
   if (fw<=0 || fh<=0) return;
   int deltaf = scale_ >= 2 ? scale_-1 : 0;
   fx += offset_x_*scale_; fy += offset_y_*scale_;
   int x = fx; int y = fy;
-  int w = int(int(fx/scale_+fw/scale_+0.5)*scale_) - x - 1 - deltaf;
-  int h = int(int(fy/scale_+fh/scale_+0.5)*scale_) - y - 1 - deltaf;
+  int w = int(fw) - 1 - deltaf;
+  int h = int(fh) - 1 - deltaf;
   if (!clip_to_short(x, y, w, h, line_width_))
     XDrawRectangle(fl_display, fl_window, gc_, x+line_delta_, y+line_delta_, w, h);
 }
@@ -208,47 +208,21 @@
   XDrawLines(fl_display, fl_window, gc_, p, 3, 0);
 }
 
-void Fl_Xlib_Graphics_Driver::xyline_unscaled(float x, float y, float x1) {//OK
+void Fl_Xlib_Graphics_Driver::xyline_unscaled(float x, float y, float x1) {
   x+=offset_x_*scale_; y+=offset_y_*scale_; x1 += offset_x_*scale_;
   int tw = line_width_ ? line_width_ : 1; // true line width
   if (x > x1) { float exch = x; x = x1; x1 = exch; }
   int ix = clip_x(x+line_delta_); if (scale_ >= 2) ix -= int(scale_/2);
   int iy = clip_x(y+line_delta_);
-  int ix1 = int(x1/scale_+1.5)*scale_-1; // extend line to pixel before line beginning at x1/scale_ + 1
+  // make sure that line output by xyline(a,b,c) extends to pixel just at left of where xyline(c+1,b,d) begins
+  int ix1 = int(x1/scale_+1.5)*scale_-1;
   ix1 += line_delta_; if (scale_ >= 4) ix1 -= 1;
   XDrawLine(fl_display, fl_window, gc_, ix, iy, ix1, iy);
-  // try and make sure no unfilled area lies between xyline(x,y,x1) and xyline(x,y+1,x1)
+  // make sure no unfilled area lies between xyline(x,y,x1) and xyline(x,y+1,x1)
   if (y+line_delta_ + scale_ >= iy + tw+1 - 0.001 ) XDrawLine(fl_display, fl_window, gc_, ix, iy+1, ix1, iy+1);
 }
 
-void Fl_Xlib_Graphics_Driver::xyline_unscaled(float x, float y, float x1, float y2) {//OK
-  x+=offset_x_*scale_; y+=offset_y_*scale_; x1 += offset_x_*scale_; y2+=offset_y_*scale_;
-  if (scale_ >= 2) {
-    int delta = int(scale_/2 + 0.5);
-    if (x > x1) x += delta; else x -= delta;
-    if (y2 > y) y2 += delta; else y2 -= delta;
-  }
-  XPoint p[3];
-  p[0].x = clip_x(x+line_delta_);  p[0].y = p[1].y = clip_x(y+line_delta_);
-  p[1].x = p[2].x = clip_x(x1+line_delta_); p[2].y = clip_x(y2+line_delta_);
-  XDrawLines(fl_display, fl_window, gc_, p, 3, 0);
-}
-
-void Fl_Xlib_Graphics_Driver::xyline_unscaled(float x, float y, float x1, float y2, float x3) {
-  x+=offset_x_*scale_; y+=offset_y_*scale_; x1 += offset_x_*scale_; y2+=offset_y_*scale_; x3 += offset_x_*scale_;
-  if (scale_ >= 2) {
-    int delta = int(scale_/2 + 0.5);
-    if (x > x1) x += delta; else x -= delta;
-    if (x3 > x1) x3 += delta; else x3 -= delta;
-  }
-  XPoint p[4];
-  p[0].x = clip_x(x+line_delta_);  p[0].y = p[1].y = clip_x(y+line_delta_);
-  p[1].x = p[2].x = clip_x(x1+line_delta_); p[2].y = p[3].y = clip_x(y2+line_delta_);
-  p[3].x = clip_x(x3+line_delta_);
-  XDrawLines(fl_display, fl_window, gc_, p, 4, 0);
-}
-
-void Fl_Xlib_Graphics_Driver::yxline_unscaled(float x, float y, float y1) {//OK
+void Fl_Xlib_Graphics_Driver::yxline_unscaled(float x, float y, float y1) {
   x+=offset_x_*scale_; y+=offset_y_*scale_; y1 += offset_y_*scale_;
   int tw = line_width_ ? line_width_ : 1; // true line width
   if (y > y1) { float exch = y; y = y1; y1 = exch; }
@@ -255,39 +229,13 @@
   int ix = clip_x(x+line_delta_);
   int iy = clip_x(y+line_delta_); if (scale_ >= 2) iy -= int(scale_/2);
   int iy1 = int(y1/scale_+1.5)*scale_-1;
-  iy1 += line_delta_; if (scale_ >= 4) iy1 -= 1; // extend line to pixel before line beginning at y1/scale_ + 1
+  // make sure that line output by yxline(a,b,c) extends to pixel just above where yxline(a,c+1,d) begins
+  iy1 += line_delta_; if (scale_ >= 4) iy1 -= 1;
   XDrawLine(fl_display, fl_window, gc_, ix, iy, ix, iy1);
-  // try and make sure no unfilled area lies between yxline(x,y,y1) and yxline(x+1,y,y1)
+  // make sure no unfilled area lies between yxline(x,y,y1) and yxline(x+1,y,y1)
   if (x+line_delta_+scale_ >= ix + tw+1 -0.001) XDrawLine(fl_display, fl_window, gc_, ix+1, iy, ix+1, iy1);
 }
 
-void Fl_Xlib_Graphics_Driver::yxline_unscaled(float x, float y, float y1, float x2) {
-  x+=offset_x_*scale_; y+=offset_y_*scale_; y1 += offset_y_*scale_; x2+=offset_x_*scale_;
-  if (scale_ >= 2) {
-    int delta = int(scale_/2 + 0.5);
-    if (y > y1) y += delta; else y -= delta;
-    if (x2 > x) x2 += delta; else x2 -= delta;
-  }
-  XPoint p[3];
-  p[0].x = p[1].x = clip_x(x+line_delta_);  p[0].y = clip_x(y+line_delta_);
-  p[1].y = p[2].y = clip_x(y1+line_delta_); p[2].x = clip_x(x2+line_delta_);
-  XDrawLines(fl_display, fl_window, gc_, p, 3, 0);
-}
-
-void Fl_Xlib_Graphics_Driver::yxline_unscaled(float x, float y, float y1, float x2, float y3) {
-  x+=offset_x_*scale_; y+=offset_y_*scale_; y1 += offset_y_*scale_; x2+=offset_x_*scale_; y3 += offset_y_*scale_;
-  if (scale_ >= 2) {
-    int delta = int(scale_/2 + 0.5);
-    if (y > y1) y += delta; else y -= delta;
-    if (y3 > y1) y3 += delta; else y3 -= delta;
-  }
-  XPoint p[4];
-  p[0].x = p[1].x = clip_x(x+line_delta_);  p[0].y = clip_x(y+line_delta_);
-  p[1].y = p[2].y = clip_x(y1+line_delta_); p[2].x = p[3].x = clip_x(x2+line_delta_);
-  p[3].y = clip_x(y3+line_delta_);
-  XDrawLines(fl_display, fl_window, gc_, p, 4, 0);
-}
-
 void Fl_Xlib_Graphics_Driver::loop_unscaled(float x, float y, float x1, float y1, float x2, float y2) {
   XPoint p[4];
   p[0].x = x +offset_x_*scale_+line_delta_;  p[0].y = y +offset_y_*scale_+line_delta_;
