Commit d66318a0 authored by Daiki Ueno's avatar Daiki Ueno
Browse files

Fix the last commit.

parent 37c25792
......@@ -208,7 +208,6 @@ render_key_outline (EekRenderer *renderer,
EekRendererPrivate *priv = EEK_RENDERER_GET_PRIVATE(renderer);
EekOutline *outline;
EekBounds bounds;
cairo_pattern_t *pat;
gdouble scale;
gint i;
gulong oref;
......@@ -243,6 +242,8 @@ render_key_outline (EekRenderer *renderer,
EEK_ELEMENT(key));
if (gradient) {
cairo_pattern_t *pat;
switch (gradient->type) {
case EEK_GRADIENT_VERTICAL:
pat = cairo_pattern_create_linear (bounds.width / 2 * priv->scale,
......@@ -277,11 +278,13 @@ render_key_outline (EekRenderer *renderer,
gradient->start->alpha);
cairo_pattern_add_color_stop_rgba (pat,
0,
gradient->stop->red,
gradient->stop->green,
gradient->stop->blue,
gradient->stop->alpha);
gradient->end->red,
gradient->end->green,
gradient->end->blue,
gradient->end->alpha);
eek_gradient_free (gradient);
cairo_set_source (cr, pat);
cairo_pattern_destroy (pat);
} else {
cairo_set_source_rgba (cr,
background->red,
......@@ -296,8 +299,6 @@ render_key_outline (EekRenderer *renderer,
outline->num_points);
cairo_fill (cr);
cairo_pattern_destroy (pat);
/* paint the border - FIXME: should be configured through theme */
cairo_set_line_width (cr, priv->border_width);
cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND);
......@@ -319,9 +320,6 @@ render_key_outline (EekRenderer *renderer,
eek_color_free (foreground);
eek_color_free (background);
if (gradient)
eek_gradient_free (gradient);
}
struct _CalculateFontSizeCallbackData {
......
......@@ -239,14 +239,14 @@ eek_gradient_get_type (void)
EekGradient *
eek_gradient_new (EekGradientType type,
EekColor *start,
EekColor *stop)
EekColor *end)
{
EekGradient *gradient;
gradient = g_slice_new (EekGradient);
gradient->type = type;
gradient->start = eek_color_copy (start);
gradient->stop = eek_color_copy (stop);
gradient->end = eek_color_copy (end);
return gradient;
}
......@@ -254,14 +254,13 @@ eek_gradient_new (EekGradientType type,
EekGradient *
eek_gradient_copy (const EekGradient *gradient)
{
return eek_gradient_new (gradient->type, gradient->start, gradient->stop);
return eek_gradient_new (gradient->type, gradient->start, gradient->end);
}
void
eek_gradient_free (EekGradient *gradient)
{
if (gradient->start)
eek_color_free (gradient->start);
if (gradient->stop)
eek_color_free (gradient->stop);
eek_color_free (gradient->start);
eek_color_free (gradient->end);
g_slice_free (EekGradient, gradient);
}
......@@ -266,7 +266,7 @@ struct _EekGradient
{
EekGradientType type;
EekColor *start;
EekColor *stop;
EekColor *end;
};
typedef struct _EekGradient EekGradient;
......@@ -274,7 +274,7 @@ GType eek_gradient_get_type (void) G_GNUC_CONST;
EekGradient *eek_gradient_new (EekGradientType type,
EekColor *start,
EekColor *stop);
EekColor *end);
EekGradient *eek_gradient_copy (const EekGradient *gradient);
void eek_gradient_free (EekGradient *gradient);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment