interpolate the position of the cubic control points correctly and set the

2003-08-28  Larry Ewing  <lewing@ximian.com>

	* app/text/gimptext-vectors.c (conicto): interpolate the position
	of the cubic control points correctly and set the previous control
	point.
	(cubicto): set the previous control point to the new value then
	add remaining points.
This commit is contained in:
Larry Ewing 2003-08-29 00:48:44 +00:00 committed by Larry Ewing
parent 56ff6be308
commit c80ed6eff6
2 changed files with 52 additions and 12 deletions

View File

@ -1,3 +1,11 @@
2003-08-28 Larry Ewing <lewing@ximian.com>
* app/text/gimptext-vectors.c (conicto): interpolate the position
of the cubic control points correctly and set the previous control
point.
(cubicto): set the previous control point to the new value then
add remaining points.
2003-08-28 Manish Singh <yosh@gimp.org>
* plug-ins/common/screenshot.c: cleanups. sizeof() isn't valid
@ -17,6 +25,7 @@
* app/gui/grid-dialog.c
* plug-ins/common/CML_explorer.c: cleanup, remove unnecessary casts.
>>>>>>> 1.6232
2003-08-28 Sven Neumann <sven@gimp.org>
* configure.in: bumped version number to 1.3.20.
@ -177,6 +186,7 @@
* app/pdb/layer_cmds.c: regenerated.
>>>>>>> 1.6230
2003-08-27 Sven Neumann <sven@gimp.org>
* app/widgets/gimpitemfactory.c (gimp_item_factory_translate_func):

View File

@ -32,6 +32,7 @@
#include "vectors/gimpbezierstroke.h"
#include "vectors/gimpvectors.h"
#include "vectors/gimpanchor.h"
#include "gimptext.h"
#include "gimptext-private.h"
@ -45,7 +46,6 @@
#define FT_GLYPH_FORMAT_OUTLINE ft_glyph_format_outline
#endif
typedef struct _RenderContext RenderContext;
struct _RenderContext
@ -134,10 +134,10 @@ moveto (FT_Vector *to,
&coords, NULL, EXTEND_SIMPLE);
context->anchor =
gimp_bezier_stroke_extend (context->stroke,
&coords, context->anchor, EXTEND_SIMPLE);
&coords, context->anchor, EXTEND_SIMPLE);
context->anchor =
gimp_bezier_stroke_extend (context->stroke,
&coords, context->anchor, EXTEND_SIMPLE);
&coords, context->anchor, EXTEND_SIMPLE);
return 0;
}
@ -172,12 +172,15 @@ lineto (FT_Vector *to,
}
static gint
conicto (FT_Vector *control,
conicto (FT_Vector *ftcontrol,
FT_Vector *to,
gpointer data)
{
RenderContext *context = (RenderContext *) data;
GimpCoords coords;
GimpCoords control;
GimpCoords last;
GList *l;
#if TEXT_DEBUG
g_printerr ("conicto %f, %f\n", to->x / 64.0, to->y / 64.0);
@ -185,21 +188,47 @@ conicto (FT_Vector *control,
if (! context->stroke)
return 0;
gimp_text_vector_coords (context, ftcontrol, &control);
gimp_text_vector_coords (context, control, &coords);
last = control;
/* Find the last endpoint */
for (l = g_list_last (context->stroke->anchors); l; l = l->prev)
{
GimpAnchor *anchor = l->data;
if (anchor->type == GIMP_ANCHOR_ANCHOR)
{
last = anchor->position;
break;
}
}
/* interpolate the cubic control point */
coords = last;
coords.x = (last.x + 2 * control.x) * (1.0 / 3.0);
coords.y = (last.y + 2 * control.y) * (1.0 / 3.0);
context->anchor->position = coords;
gimp_text_vector_coords (context, to, &last);
/* interpolate the cubic control point */
coords = last;
coords.x = (last.x + 2 * control.x) * (1.0 / 3.0);
coords.y = (last.y + 2 * control.y) * (1.0 / 3.0);
context->anchor =
gimp_bezier_stroke_extend (context->stroke,
&coords, context->anchor, EXTEND_SIMPLE);
gimp_text_vector_coords (context, to, &coords);
context->anchor =
gimp_bezier_stroke_extend (context->stroke,
&coords, context->anchor, EXTEND_SIMPLE);
&last, context->anchor, EXTEND_SIMPLE);
context->anchor =
gimp_bezier_stroke_extend (context->stroke,
&coords, context->anchor, EXTEND_SIMPLE);
&last, context->anchor, EXTEND_SIMPLE);
return 0;
}
@ -222,6 +251,10 @@ cubicto (FT_Vector *control1,
gimp_text_vector_coords (context, control1, &coords);
context->anchor->position = coords;
gimp_text_vector_coords (context, control2, &coords);
context->anchor =
gimp_bezier_stroke_extend (context->stroke,
&coords, context->anchor, EXTEND_SIMPLE);
@ -231,9 +264,6 @@ cubicto (FT_Vector *control1,
context->anchor =
gimp_bezier_stroke_extend (context->stroke,
&coords, context->anchor, EXTEND_SIMPLE);
gimp_text_vector_coords (context, control2, &coords);
context->anchor =
gimp_bezier_stroke_extend (context->stroke,
&coords, context->anchor, EXTEND_SIMPLE);