gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] gzz/gzz/view/buoy buoymanager.py pagespanNodes.py


From: Tuomas J. Lukka
Subject: [Gzz-commits] gzz/gzz/view/buoy buoymanager.py pagespanNodes.py
Date: Tue, 11 Feb 2003 05:36:13 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Tuomas J. Lukka <address@hidden>        03/02/11 05:36:13

Modified files:
        gzz/view/buoy  : buoymanager.py pagespanNodes.py 

Log message:
        Debugging the buoys in buoyoing

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/buoy/buoymanager.py.diff?tr1=1.17&tr2=1.18&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/buoy/pagespanNodes.py.diff?tr1=1.23&tr2=1.24&r1=text&r2=text

Patches:
Index: gzz/gzz/view/buoy/buoymanager.py
diff -u gzz/gzz/view/buoy/buoymanager.py:1.17 
gzz/gzz/view/buoy/buoymanager.py:1.18
--- gzz/gzz/view/buoy/buoymanager.py:1.17       Mon Feb 10 11:59:22 2003
+++ gzz/gzz/view/buoy/buoymanager.py    Tue Feb 11 05:36:13 2003
@@ -72,12 +72,12 @@
            buoy = self.vs.coords.buoyOnCircle(0, anchorCS,
                                x, self.ctry, r, 
                                x-r, self.ctry, 
-                               1.1)
+                               .1)
        else:
            buoy = self.vs.coords.buoyOnCircle(0, anchorCS,
                                x, self.ctry, r, 
                                x+r, self.ctry,
-                               1.1)
+                               .1)
        self.vs.matcher.add(buoy, linkId)
        into = self.vs.orthoBoxCS(buoy, "V", -100, 0, 0, .5, .5, 150, 150)
        into = self.nadir(into)
Index: gzz/gzz/view/buoy/pagespanNodes.py
diff -u gzz/gzz/view/buoy/pagespanNodes.py:1.23 
gzz/gzz/view/buoy/pagespanNodes.py:1.24
--- gzz/gzz/view/buoy/pagespanNodes.py:1.23     Tue Feb 11 02:42:26 2003
+++ gzz/gzz/view/buoy/pagespanNodes.py  Tue Feb 11 05:36:13 2003
@@ -1,3 +1,5 @@
+from __future__ import nested_scopes
+
 """A pagespan scroll shown in a buoy view.
 
 An interesting point: if this is from a transclusion, we
@@ -7,12 +9,15 @@
 """
 
 import jarray
+import java
 
 # Page span scrollblock as a whole;
 # in buoys, a part is shown.
 
 import gzz
+import gfx
 from gzz.view.buoy import BuoyViewNodeType, BuoyViewMainNode
+from gfx.util.misc import coloredQuad
 
 pscv = gzz.view.PageSpanCellView()
 pscv.useBg = 0
@@ -49,13 +54,56 @@
 
 class AnchorPageSpanNodeType(AbstractPageSpanNodeType):
     def renderBuoy(self, vs, into, linkId, anchorSpan, layout):
+       if 1:
+           dbg1 = vs.unitSqCS(into, "U")
+           vs.put(coloredQuad((1,0,0)), dbg1)
+
        if layout == None: 
            layout = pscv.getLayout(anchorSpan.getScrollBlock())
+       vs.coords.getSqSize(into, size)
+       extents = layout.getExtents(anchorSpan, None)
+       print "ExtentsInit: ", [i for i in extents]
+       print "size: ", [s for s in size]
+       scalex = size[0] / extents[2] 
+       scaley = size[1] / extents[3] 
+       scale = min(scalex, scaley)
+
+       # Shift it so we hit the given cs exactly
+       # extents[0] -= .5 * (scalex / scale - 1) * extents[2]
+       # extents[1] -= .5 * (scaley / scale - 1) * extents[3]
+       extents[2] *= scalex / scale 
+       extents[3] *= scaley / scale 
+
+       print "Extents: ", [i for i in extents]
+
+       paperCS = vs.orthoCS(into, "paper", 0, -extents[0] * scale,
+                               -extents[1] * scale, scale, scale)
+
+       irregu = gfx.libutil.effects.IrreguFrame(0, 0, layout.w, layout.h,
+                   .05, .25, type="square")
+#      irregu = gfx.libutil.effects.IrreguFrame(-100, -100, 100*layout.w, 
100*layout.h,
+#                  .05, .25, type="square")
+       
+       paperLoc = vs.coords.ortho(0, 0, extents[0], extents[1], extents[2], 
extents[3])
+       vs.matcher.add(paperCS, paperLoc, "VIEWPORT")
+
+       class FrameR(java.lang.Runnable):
+           def run(rself):
+               vs.map.put(irregu.frame, paperCS, paperLoc)
+       class ContentR(java.lang.Runnable):
+           def run(rself):
+               vs.map.put(irregu.content, paperCS, paperLoc)
+       class LayoutR(java.lang.Runnable):
+           def run(rself):
+               layout.place(vs, paperCS, .5, 200, into)
+       
+       gzz.gfx.gl.Stencil.drawStenciled(vs, ContentR(), None, FrameR(), 
LayoutR(), 1)
+
+
        # XXX!!!!
        # Irregu!
        # find edges of span
        # should place only that region surrounded by irregu
-       layout.place(vs, into, .5, 200, into)
        return into
 
 size = jarray.zeros(3, 'f')




reply via email to

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