Fix gradient drawing.
This commit is contained in:
@ -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 ();
|
||||||
|
|||||||
Reference in New Issue
Block a user