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

Fix gradient drawing.

parent 2a8d7cf0
...@@ -251,27 +251,30 @@ render_key_outline (EekRenderer *renderer, ...@@ -251,27 +251,30 @@ render_key_outline (EekRenderer *renderer,
if (gradient) { if (gradient) {
cairo_pattern_t *pat; cairo_pattern_t *pat;
gdouble cx, cy;
switch (gradient->type) { switch (gradient->type) {
case EEK_GRADIENT_VERTICAL: case EEK_GRADIENT_VERTICAL:
pat = cairo_pattern_create_linear (bounds.width / 2 * priv->scale, pat = cairo_pattern_create_linear (0.0,
0.0,
0.0, 0.0,
bounds.width / 2 * priv->scale,
bounds.height * priv->scale); bounds.height * priv->scale);
break; break;
case EEK_GRADIENT_HORIZONTAL: case EEK_GRADIENT_HORIZONTAL:
pat = cairo_pattern_create_linear (0.0, pat = cairo_pattern_create_linear (0.0,
bounds.height / 2 * priv->scale, 0.0,
bounds.width * priv->scale, bounds.width * priv->scale,
bounds.height / 2 * priv->scale); 0.0);
break; break;
case EEK_GRADIENT_RADIAL: case EEK_GRADIENT_RADIAL:
pat = cairo_pattern_create_radial (0.0, cx = bounds.width / 2 * priv->scale;
0.0, cy = bounds.height / 2 * priv->scale;
pat = cairo_pattern_create_radial (cx,
cy,
0, 0,
0.0, cx,
0.0, cy,
MIN(bounds.width, bounds.height) * priv->scale); MIN(cx, cy));
break; break;
default: default:
g_assert_not_reached (); g_assert_not_reached ();
......
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