[Commit] cairo/src cairo_font.c,1.4,1.5 cairo_traps.c,1.9,1.10
Carl Worth
commit at keithp.com
Fri Aug 29 18:48:50 PDT 2003
Committed by: cworth
Update of /local/src/CVS/cairo/src
In directory home.keithp.com:/tmp/cvs-serv8725
Modified Files:
cairo_font.c cairo_traps.c
Log Message:
Fixed to use fabs not abs. Added pointer to Hobby's intersection paper.
Index: cairo_font.c
===================================================================
RCS file: /local/src/CVS/cairo/src/cairo_font.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- cairo_font.c 28 Aug 2003 21:12:08 -0000 1.4
+++ cairo_font.c 30 Aug 2003 00:48:48 -0000 1.5
@@ -143,7 +143,8 @@
X/Y scaling. Is there anything different we would want to do
for non-uniform X/Y scaling? */
_cairo_matrix_compute_determinant (&matrix, &expansion);
- font_size = sqrt (abs(expansion));
+ font_size = sqrt (fabs (expansion));
+
FcPatternAddDouble (pattern, "pixelsize", font_size);
cairo_matrix_scale (&matrix, 1.0 / font_size, 1.0 / font_size);
Index: cairo_traps.c
===================================================================
RCS file: /local/src/CVS/cairo/src/cairo_traps.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- cairo_traps.c 26 Aug 2003 14:40:17 -0000 1.9
+++ cairo_traps.c 30 Aug 2003 00:48:48 -0000 1.10
@@ -434,6 +434,27 @@
*/
if (_compute_x (l2, y_intersect) > _compute_x (l1, y_intersect))
y_intersect++;
+ /* XXX: hmm... now I found "intersection_killer" inside xrspline.c
+ that requires 3 increments. Clearly, we haven't characterized
+ this completely yet. */
+ if (_compute_x (l2, y_intersect) > _compute_x (l1, y_intersect))
+ y_intersect++;
+ /* I think I've found the answer to our problems. The insight is
+ that everytime we round we are changing the slopes of the
+ relevant lines, so we may be introducing new intersections that
+ we miss, so everything breaks apart. John Hobby wrote a paper
+ on how to fix this:
+
+ [Hobby93c] John D. Hobby, Practical Segment Intersection with
+ Finite Precision Output, Computation Geometry Theory and
+ Applications, 13(4), 1999.
+
+ Available online (2003-08017):
+
+ http://cm.bell-labs.com/cm/cs/doc/93/2-27.ps.gz
+
+ Now we just need to go off and implement that.
+ */
*y_ret = y_intersect;
More information about the Commit
mailing list