gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] fenfire/org/fenfire/view PaperView2D.java


From: Tuomas J. Lukka
Subject: [Gzz-commits] fenfire/org/fenfire/view PaperView2D.java
Date: Fri, 25 Apr 2003 08:44:43 -0400

CVSROOT:        /cvsroot/fenfire
Module name:    fenfire
Changes by:     Tuomas J. Lukka <address@hidden>        03/04/25 08:44:43

Modified files:
        org/fenfire/view: PaperView2D.java 

Log message:
        Fix paperview sliding

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/fenfire/fenfire/org/fenfire/view/PaperView2D.java.diff?tr1=1.3&tr2=1.4&r1=text&r2=text

Patches:
Index: fenfire/org/fenfire/view/PaperView2D.java
diff -u fenfire/org/fenfire/view/PaperView2D.java:1.3 
fenfire/org/fenfire/view/PaperView2D.java:1.4
--- fenfire/org/fenfire/view/PaperView2D.java:1.3       Thu Apr 24 16:52:23 2003
+++ fenfire/org/fenfire/view/PaperView2D.java   Fri Apr 25 08:44:43 2003
@@ -12,15 +12,20 @@
  * this other view is rendered on top of the paper.
  */
 public class PaperView2D extends View2D {
+    public static boolean dbg = true;
+public static final String rcsid = "$Id: PaperView2D.java,v 1.4 2003/04/25 
12:44:43 tjl Exp $";
+    private static void pa(String s) { System.out.println("AlphContent: "+s); }
+
     public PaperMill paperMill;
     public float dicefactor = 1;
     public int flags = 0;
 
+    public float paperScaling = 1/200f;
+
     protected View2D child;
     
     public PaperView2D(GraphicsAPI.RenderingSurface optWin) { 
-       this.optWin = optWin;
-       this.child = null; 
+       this(optWin, null);
     }
     public PaperView2D(GraphicsAPI.RenderingSurface optWin,
                       View2D child) { 
@@ -31,6 +36,7 @@
     public GraphicsAPI.RenderingSurface optWin;
 
     private float[] tmp = new float[2];
+    private float[] tmp2 = new float[2];
     public void render(VobScene vs, 
                Object plane,
                int matchingParent,
@@ -46,10 +52,17 @@
        org.nongnu.libvob.Vob v = GLRen.createEasyPaperQuad(
                    p, dicefactor, flags);
        
-       vs.coords.getSqSize(box2paper, tmp);
-       int magnified = vs.coords.orthoBox(box2paper, 0, 0, 0,
-                                          1/200f, 1/200f,
-                                          tmp[0], tmp[1]);
+       int magnified = box2paper;
+       if(paperScaling != 1) {
+           int magnify = vs.coords.scale(0, paperScaling, paperScaling);
+           magnified = vs.coords.concat(magnify, magnified);
+           if(dbg) {
+               vs.coords.getSqSize(box2paper, tmp);
+               vs.coords.getSqSize(magnified, tmp2);
+               pa("SQSIZES: "+tmp[0]+" "+tmp[1]+" "+tmp2[0]+" "+tmp2[1]);
+           }
+
+       }
        vs.put(v, box2screen, magnified);
 
        if(child != null)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]