[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz gfx/librenderables/renderables.py gzz/view/...
From: |
Benja Fallenstein |
Subject: |
[Gzz-commits] gzz gfx/librenderables/renderables.py gzz/view/... |
Date: |
Sat, 28 Sep 2002 18:55:13 -0400 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Benja Fallenstein <address@hidden> 02/09/28 18:55:13
Modified files:
gfx/librenderables: renderables.py
gzz/view : CellVobFactory.java LastOpDecorator.java
LinebrokenCellContentView.java
TextCellContentView.java
VobVanishingClient.java
gzz/vob : HBroken.java
Log message:
Half-fix text. Now, no scaling (wrong scaling was what completely
messed up
things before). Big problem right now is that the -1,-1 coordinate
supplied by TextVob as ul corner of text is taken as left/baseline
coordinate of text...
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/librenderables/renderables.py.diff?tr1=1.80&tr2=1.81&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/CellVobFactory.java.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/LastOpDecorator.java.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/LinebrokenCellContentView.java.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/TextCellContentView.java.diff?tr1=1.12&tr2=1.13&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/view/VobVanishingClient.java.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gzz/vob/HBroken.java.diff?tr1=1.5&tr2=1.6&r1=text&r2=text
Patches:
Index: gzz/gfx/librenderables/renderables.py
diff -c gzz/gfx/librenderables/renderables.py:1.80
gzz/gfx/librenderables/renderables.py:1.81
*** gzz/gfx/librenderables/renderables.py:1.80 Sat Sep 28 07:23:38 2002
--- gzz/gfx/librenderables/renderables.py Sat Sep 28 18:55:13 2002
***************
*** 862,876 ****
""",
"ExtraClass" : """
template<class Coords> struct Vertexer {
! const Coords &c;
float scale;
float z;
! Vertexer(Coords &c, float scale, float z) : c(c), scale(scale),
z(z) { }
template<class T> void operator()(const T &x, const T &y) {
! ZPt tmp(x * scale, y * scale, 0);
c.vertex(tmp);
! DBG(dbg_horiztext2) << "Vertex: "<<x<<" "<<y<<" "<<tmp<<"
"<<c.transform(tmp)
! << "\\n";
}
};
""",
--- 862,879 ----
""",
"ExtraClass" : """
template<class Coords> struct Vertexer {
! const Coords &c, &ci, &c1;
float scale;
float z;
! Vertexer(Coords &c, Coords &ci, Coords &c1,
! float scale, float z) : c(c), ci(ci), c1(c1),
scale(scale), z(z) { }
template<class T> void operator()(const T &x, const T &y) {
! ZPt tmp(x, y, 0);
! //tmp = c1.transform(tmp);
! //tmp = ci.transform(tmp);
c.vertex(tmp);
! //DBG(dbg_horiztext2) << "Vertex: "<<x<<" "<<y<<" "<<tmp<<"
"<<c.transform(tmp)
! // << "\\n";
}
};
""",
***************
*** 879,887 ****
ZPt orig = coords2inv->transform(coords1.transform(origin));
// ZPt h =
coords2inv->transform(coords1.transform(origin+ZVec(0,h1,0)));
// float scale = (h-orig).length();
DBG(dbg_horiztext2) << "Origin: "<<origin<<"
"<<coords1.transform(origin)<<orig<<"\\n";
// DBG(dbg_horiztext2) << "h: "<<h1<<" "<<h<<" "<<scale<<"\\n";
! Vertexer<Coords> v(coords2, h1, orig.z);
glPushAttrib(GL_ENABLE_BIT);
glEnable(GL_BLEND);
Text::renderIter(*r, txt.begin(), txt.end(),
--- 882,893 ----
ZPt orig = coords2inv->transform(coords1.transform(origin));
// ZPt h =
coords2inv->transform(coords1.transform(origin+ZVec(0,h1,0)));
// float scale = (h-orig).length();
+ ZPt zero(0, 0, 0);
+ ZPt one(1, 1, 0);
+ DBG(dbg_horiztext2) << "HT2 coordsys:
"<<coords1.transform(zero)<<coords2.transform(zero)<<coords2.transform(one)<<"\\n";
DBG(dbg_horiztext2) << "Origin: "<<origin<<"
"<<coords1.transform(origin)<<orig<<"\\n";
// DBG(dbg_horiztext2) << "h: "<<h1<<" "<<h<<" "<<scale<<"\\n";
! Vertexer<Coords> v(coords2, *coords2inv, coords1, h1, orig.z);
glPushAttrib(GL_ENABLE_BIT);
glEnable(GL_BLEND);
Text::renderIter(*r, txt.begin(), txt.end(),
Index: gzz/gzz/view/CellVobFactory.java
diff -c gzz/gzz/view/CellVobFactory.java:1.14
gzz/gzz/view/CellVobFactory.java:1.15
*** gzz/gzz/view/CellVobFactory.java:1.14 Sat Sep 28 13:18:11 2002
--- gzz/gzz/view/CellVobFactory.java Sat Sep 28 18:55:13 2002
***************
*** 46,52 ****
*/
public class CellVobFactory implements CellView {
! public static final String rcsid = "$Id: CellVobFactory.java,v 1.14
2002/09/28 17:18:11 benja Exp $";
public static boolean dbg = false;
private static void p(String s) { if(dbg) pa(s); }
private static void pa(String s) { System.err.println(s); }
--- 46,52 ----
*/
public class CellVobFactory implements CellView {
! public static final String rcsid = "$Id: CellVobFactory.java,v 1.15
2002/09/28 22:55:13 benja Exp $";
public static boolean dbg = false;
private static void p(String s) { if(dbg) pa(s); }
private static void pa(String s) { System.err.println(s); }
***************
*** 181,198 ****
else
ccv.place(c, v, cs_out, content_cs, x, y, w, h, context, scale);
} else {
! gzz.gfx.gl.Stencil.drawStenciled(
v,
new Runnable() { public void run() {
v.map.put(bg, cs_box);
}},
null,
null,
! new Runnable() { public void run() {
ccv.place(c, v, cs_out, cs_box, x, y, w, h, context, scale);
! }},
false
! );
}
}
}
--- 181,198 ----
else
ccv.place(c, v, cs_out, content_cs, x, y, w, h, context, scale);
} else {
! /*gzz.gfx.gl.Stencil.drawStenciled(
v,
new Runnable() { public void run() {
v.map.put(bg, cs_box);
}},
null,
null,
! new Runnable() { public void run() {*/
ccv.place(c, v, cs_out, cs_box, x, y, w, h, context, scale);
! /*}},
false
! );*/
}
}
}
Index: gzz/gzz/view/LastOpDecorator.java
diff -c gzz/gzz/view/LastOpDecorator.java:1.11
gzz/gzz/view/LastOpDecorator.java:1.12
*** gzz/gzz/view/LastOpDecorator.java:1.11 Sat Sep 28 13:18:11 2002
--- gzz/gzz/view/LastOpDecorator.java Sat Sep 28 18:55:13 2002
***************
*** 32,38 ****
* directional op entered.
*/
public class LastOpDecorator implements FallbackSceneDecorator {
! String rcsid = "$Id: LastOpDecorator.java,v 1.11 2002/09/28 17:18:11 benja
Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.err.println(s); }
--- 32,38 ----
* directional op entered.
*/
public class LastOpDecorator implements FallbackSceneDecorator {
! String rcsid = "$Id: LastOpDecorator.java,v 1.12 2002/09/28 22:55:13 benja
Exp $";
public static boolean dbg = false;
private static void pa(String s) { System.err.println(s); }
***************
*** 114,122 ****
float x = padding;
float y = size.height - padding - h;
! int cs = sc.coordsys(into, key, 0, x, y, w, h);
! br.put(sc, cs);
if(dbg) pa("Put "+br+" "+ch.length()+" in cs "+cs+" @ "+x+" "+y+"
"+w+" "+h+" ("+size+")");
}
--- 114,122 ----
float x = padding;
float y = size.height - padding - h;
! int cs = sc.coordsys(into, key, 0, x, y, 2, 2);
! br.put(sc, into, cs);
if(dbg) pa("Put "+br+" "+ch.length()+" in cs "+cs+" @ "+x+" "+y+"
"+w+" "+h+" ("+size+")");
}
Index: gzz/gzz/view/LinebrokenCellContentView.java
diff -c gzz/gzz/view/LinebrokenCellContentView.java:1.6
gzz/gzz/view/LinebrokenCellContentView.java:1.7
*** gzz/gzz/view/LinebrokenCellContentView.java:1.6 Fri Sep 27 05:07:56 2002
--- gzz/gzz/view/LinebrokenCellContentView.java Sat Sep 28 18:55:13 2002
***************
*** 38,47 ****
*/
public class LinebrokenCellContentView implements CellContentView {
! public static final String rcsid = "$Id: LinebrokenCellContentView.java,v 1.6
2002/09/27 09:07:56 tjl Exp $";
public static boolean dbg = false;
private static void p(String s) { if(dbg) pa(s); }
private static void pa(String s) { System.err.println(s); }
TextStyle style;
SimpleLinebreaker breaker = new SimpleLinebreaker();
--- 38,49 ----
*/
public class LinebrokenCellContentView implements CellContentView {
! public static final String rcsid = "$Id: LinebrokenCellContentView.java,v 1.7
2002/09/28 22:55:13 benja Exp $";
public static boolean dbg = false;
private static void p(String s) { if(dbg) pa(s); }
private static void pa(String s) { System.err.println(s); }
+
+ static Object ARGH_KEY = new Object();
TextStyle style;
SimpleLinebreaker breaker = new SimpleLinebreaker();
***************
*** 64,70 ****
HChain ch = getChain(c, scale);
if(dbg) pa(""+w);
HBroken br = breaker.breakLines(ch, w, scale);
! br.put(vs, coordsys_box);
}
protected HChain getChain(Cell c, float scale) {
--- 66,77 ----
HChain ch = getChain(c, scale);
if(dbg) pa(""+w);
HBroken br = breaker.breakLines(ch, w, scale);
!
! //argh!
! int cs = vs.coords.coordsys(coordsys_outside, 0, x, y, 2, 2);
! ((DefaultVobMatcher)vs.matcher).addSub(coordsys_box, cs, ARGH_KEY);
!
! br.put(vs, coordsys_outside, cs);
}
protected HChain getChain(Cell c, float scale) {
Index: gzz/gzz/view/TextCellContentView.java
diff -c gzz/gzz/view/TextCellContentView.java:1.12
gzz/gzz/view/TextCellContentView.java:1.13
*** gzz/gzz/view/TextCellContentView.java:1.12 Sat Sep 28 05:14:17 2002
--- gzz/gzz/view/TextCellContentView.java Sat Sep 28 18:55:13 2002
***************
*** 37,43 ****
*/
public class TextCellContentView implements CellContentView {
! public static final String rcsid = "$Id: TextCellContentView.java,v 1.12
2002/09/28 09:14:17 benja Exp $";
public static boolean dbg = false;
private static void p(String s) { if(dbg) pa(s); }
private static void pa(String s) { System.err.println(s); }
--- 37,43 ----
*/
public class TextCellContentView implements CellContentView {
! public static final String rcsid = "$Id: TextCellContentView.java,v 1.13
2002/09/28 22:55:13 benja Exp $";
public static boolean dbg = false;
private static void p(String s) { if(dbg) pa(s); }
private static void pa(String s) { System.err.println(s); }
***************
*** 94,100 ****
protected void placeVob(Cell c, VobScene v, int cs_out, int cs_box, int
start, int end,
int offs, ViewContext context, float scale) {
TextVob vob = new TextVob(style, scale, c.t().substring(start, end));
! v.map.put(vob, cs_box, cs_out);
if(offs >= 0)
v.map.put(new TextCursorVob(vob, offs), cs_box);
--- 94,100 ----
protected void placeVob(Cell c, VobScene v, int cs_out, int cs_box, int
start, int end,
int offs, ViewContext context, float scale) {
TextVob vob = new TextVob(style, scale, c.t().substring(start, end));
! v.map.put(vob, cs_box);//, cs_out);
if(offs >= 0)
v.map.put(new TextCursorVob(vob, offs), cs_box);
Index: gzz/gzz/view/VobVanishingClient.java
diff -c gzz/gzz/view/VobVanishingClient.java:1.10
gzz/gzz/view/VobVanishingClient.java:1.11
*** gzz/gzz/view/VobVanishingClient.java:1.10 Sat Sep 28 05:14:17 2002
--- gzz/gzz/view/VobVanishingClient.java Sat Sep 28 18:55:13 2002
***************
*** 169,175 ****
intoCS, cs,
(x0+x1)/2, (y0+y1)/2, (x1-x0)/2, (y1-y0)/2, v, context, fract);
cvf.place(c, into, intoCS, cs,
! (x0+x1)/2, (y0+y1)/2, (x1-x0)/2, (y1-y0)/2, context, fract);
}
public void connect(Cell cell1, Cell cell2, int dx, int dy) {
--- 169,175 ----
intoCS, cs,
(x0+x1)/2, (y0+y1)/2, (x1-x0)/2, (y1-y0)/2, v, context, fract);
cvf.place(c, into, intoCS, cs,
! x0, y0, (x1-x0), (y1-y0), context, fract);
}
public void connect(Cell cell1, Cell cell2, int dx, int dy) {
Index: gzz/gzz/vob/HBroken.java
diff -c gzz/gzz/vob/HBroken.java:1.5 gzz/gzz/vob/HBroken.java:1.6
*** gzz/gzz/vob/HBroken.java:1.5 Fri Sep 27 05:07:56 2002
--- gzz/gzz/vob/HBroken.java Sat Sep 28 18:55:13 2002
***************
*** 53,59 ****
length++;
}
! public void put(VobScene vs, int coordsys) {
int x = 0, y = 0;
for(int i=0; i<=length; i++) {
--- 53,59 ----
length++;
}
! public void put(VobScene vs, int coordsys_outside, int coordsys) {
int x = 0, y = 0;
for(int i=0; i<=length; i++) {
***************
*** 76,82 ****
Object key = box.getKey();
int cs = vs.coordsys(coordsys, key, 0, x, y, w, h);
! box.place(vs, coordsys, cs, x, y, w, h, scale);
x += w;
}
--- 76,82 ----
Object key = box.getKey();
int cs = vs.coordsys(coordsys, key, 0, x, y, w, h);
! box.place(vs, coordsys_outside, cs, x, y, w, h, scale);
x += w;
}
- [Gzz-commits] gzz gfx/librenderables/renderables.py gzz/view/...,
Benja Fallenstein <=