chiark / gitweb /
X window size is a parameter; scale is a parameter; whether to draw original strip...
[moebius.git] / x11.cc
diff --git a/x11.cc b/x11.cc
index b724594e676253fef6a5bb80082704495b67838a..b88a5e9da69279a3a59573afb18cdb81ba311972 100644 (file)
--- a/x11.cc
+++ b/x11.cc
@@ -4,13 +4,16 @@
 
 
 #include "x11.hh"
+#include "parameter.hh"
+
+static Parameter<int> x11size("x11size", "X11 window size", 500, 100, 10, 10000);
 
 X11Output::X11Output() {
   XGCValues gcvalues;
   display= XOpenDisplay(0);
   window= XCreateSimpleWindow(display,
                               DefaultRootWindow(display),
-                              0,0, 500,500, 0,0,0);
+                              0,0, x11size,x11size, 0,0,0);
   gcvalues.background= 0;
   fabric= XCreateGC(display,window,GCBackground,&gcvalues);
   gcvalues.foreground= 1;
@@ -37,8 +40,8 @@ void X11Output::drawcell(const Point* list, int n) {
   XPoint xp[n+1];
   for (int i=0; i<n; i++) {
     Onscreen here= Onscreen(list[i]);
-    xp[i].x= (int)((here.x+1.0)*250.0);
-    xp[i].y= (int)((-here.y+1.0)*250.0);
+    xp[i].x= (int)((here.x+1.0)*(x11size*0.5));
+    xp[i].y= (int)((-here.y+1.0)*(x11size*0.5));
   }
   XFillPolygon(display,window,fabric,xp,n,Nonconvex,CoordModeOrigin);
   xp[n]= xp[0];