Author: manolo
Date: 2011-02-04 01:17:45 -0800 (Fri, 04 Feb 2011)
New Revision: 8366
Log:
Added the possibility to call Fl_Paged_Device::scale(factor) with a single 
argument.

Modified:
   branches/branch-1.3/FL/Fl_Paged_Device.H
   branches/branch-1.3/FL/Fl_PostScript.H
   branches/branch-1.3/FL/Fl_Printer.H
   branches/branch-1.3/src/Fl_GDI_Printer.cxx
   branches/branch-1.3/src/Fl_Paged_Device.cxx
   branches/branch-1.3/src/Fl_PostScript.cxx
   branches/branch-1.3/src/Fl_Quartz_Printer.mm
   branches/branch-1.3/src/Fl_cocoa.mm

Modified: branches/branch-1.3/FL/Fl_Paged_Device.H
===================================================================
--- branches/branch-1.3/FL/Fl_Paged_Device.H    2011-02-03 23:00:30 UTC (rev 
8365)
+++ branches/branch-1.3/FL/Fl_Paged_Device.H    2011-02-04 09:17:45 UTC (rev 
8366)
@@ -126,7 +126,7 @@
   virtual void margins(int *left, int *top, int *right, int *bottom);
   virtual void origin(int x, int y);
   virtual void origin(int *x, int *y);
-  virtual void scale(float scale_x, float scale_y);
+  virtual void scale(float scale_x, float scale_y = 0.);
   virtual void rotate(float angle);
   virtual void translate(int x, int y);
   virtual void untranslate(void);

Modified: branches/branch-1.3/FL/Fl_PostScript.H
===================================================================
--- branches/branch-1.3/FL/Fl_PostScript.H      2011-02-03 23:00:30 UTC (rev 
8365)
+++ branches/branch-1.3/FL/Fl_PostScript.H      2011-02-04 09:17:45 UTC (rev 
8366)
@@ -234,7 +234,7 @@
   void margins(int *left, int *top, int *right, int *bottom);
   void origin(int *x, int *y);
   void origin(int x, int y);
-  void scale (float scale_x, float scale_y);
+  void scale (float scale_x, float scale_y = 0.);
   void rotate(float angle);
   void translate(int x, int y);
   void untranslate(void);

Modified: branches/branch-1.3/FL/Fl_Printer.H
===================================================================
--- branches/branch-1.3/FL/Fl_Printer.H 2011-02-03 23:00:30 UTC (rev 8365)
+++ branches/branch-1.3/FL/Fl_Printer.H 2011-02-04 09:17:45 UTC (rev 8366)
@@ -85,7 +85,7 @@
   void margins(int *left, int *top, int *right, int *bottom);
   void origin(int *x, int *y);
   void origin(int x, int y);
-  void scale (float scale_x, float scale_y);
+  void scale (float scale_x, float scale_y = 0.);
   void rotate(float angle);
   void translate(int x, int y);
   void untranslate(void);
@@ -160,7 +160,7 @@
   void margins(int *left, int *top, int *right, int *bottom);
   void origin(int *x, int *y);
   void origin(int x, int y);
-  void scale(float scale_x, float scale_y);
+  void scale(float scale_x, float scale_y = 0.);
   void rotate(float angle);
   void translate(int x, int y);
   void untranslate(void);

Modified: branches/branch-1.3/src/Fl_GDI_Printer.cxx
===================================================================
--- branches/branch-1.3/src/Fl_GDI_Printer.cxx  2011-02-03 23:00:30 UTC (rev 
8365)
+++ branches/branch-1.3/src/Fl_GDI_Printer.cxx  2011-02-04 09:17:45 UTC (rev 
8366)
@@ -209,6 +209,7 @@
 
 void Fl_System_Printer::scale (float scalex, float scaley)
 {
+  if (scaley == 0.) scaley = scalex;
   int w, h;
   SetWindowExtEx(fl_gc, (int)(720 / scalex + 0.5), (int)(720 / scaley + 0.5), 
NULL);
   printable_rect(&w, &h);

Modified: branches/branch-1.3/src/Fl_Paged_Device.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Paged_Device.cxx 2011-02-03 23:00:30 UTC (rev 
8365)
+++ branches/branch-1.3/src/Fl_Paged_Device.cxx 2011-02-04 09:17:45 UTC (rev 
8366)
@@ -206,7 +206,9 @@
  After a scale() call, do a printable_rect() call to get the new dimensions of 
the printable page area.
  Successive scale() calls don't combine their effects.
  @param scale_x Horizontal dimensions of plot are multiplied by this quantity.
- @param scale_y Same as above, vertically.
+ @param scale_y Same as above, vertically. 
+  The value 0. is equivalent to setting \p scale_y = \p scale_x. Thus, 
scale(factor);
+  is equivalent to scale(factor, factor);
  */
 void Fl_Paged_Device::scale (float scale_x, float scale_y) {}
 

Modified: branches/branch-1.3/src/Fl_PostScript.cxx
===================================================================
--- branches/branch-1.3/src/Fl_PostScript.cxx   2011-02-03 23:00:30 UTC (rev 
8365)
+++ branches/branch-1.3/src/Fl_PostScript.cxx   2011-02-04 09:17:45 UTC (rev 
8366)
@@ -1402,6 +1402,7 @@
 
 void Fl_PostScript_File_Device::scale (float s_x, float s_y)
 {
+  if (s_y == 0.) s_y = s_x;
   Fl_PostScript_Graphics_Driver *ps = driver();
   ps->scale_x = s_x;
   ps->scale_y = s_y;

Modified: branches/branch-1.3/src/Fl_Quartz_Printer.mm
===================================================================
--- branches/branch-1.3/src/Fl_Quartz_Printer.mm        2011-02-03 23:00:30 UTC 
(rev 8365)
+++ branches/branch-1.3/src/Fl_Quartz_Printer.mm        2011-02-04 09:17:45 UTC 
(rev 8366)
@@ -193,6 +193,7 @@
 
 void Fl_System_Printer::scale (float s_x, float s_y)
 {
+  if (s_y == 0.) s_y = s_x;
   scale_x = s_x;
   scale_y = s_y;
   CGContextRestoreGState(fl_gc);

Modified: branches/branch-1.3/src/Fl_cocoa.mm
===================================================================
--- branches/branch-1.3/src/Fl_cocoa.mm 2011-02-03 23:00:30 UTC (rev 8365)
+++ branches/branch-1.3/src/Fl_cocoa.mm 2011-02-04 09:17:45 UTC (rev 8366)
@@ -2787,7 +2787,7 @@
   if (win->w()>w || win->h()>h) {
     scale = (float)w/win->w();
     if ((float)h/win->h() < scale) scale = (float)h/win->h();
-    printer.scale(scale, scale);
+    printer.scale(scale);
   }
 //#define ROTATE 1
 #ifdef ROTATE

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to