Fixed wrong color for filling.
This commit is contained in:
parent
dfba745f6a
commit
13b47c5542
|
@ -13,19 +13,21 @@ namespace Cairo
|
|||
}
|
||||
void DrawContext::fill(color_space r, color_space g, color_space b, color_space a)
|
||||
{
|
||||
save();
|
||||
cairo_set_source_rgba (ctx_, r, g, b, a);
|
||||
save();
|
||||
cairo_set_source_rgba(
|
||||
ctx_,
|
||||
static_cast <double> (r) / colorMax,
|
||||
static_cast <double> (g) / colorMax,
|
||||
static_cast <double> (b) / colorMax,
|
||||
static_cast <double> (a) / colorMax
|
||||
);
|
||||
cairo_set_operator(ctx_, CAIRO_OPERATOR_SOURCE);
|
||||
cairo_paint(ctx_);
|
||||
restore();
|
||||
}
|
||||
void DrawContext::fill(RGBA color)
|
||||
{
|
||||
save();
|
||||
cairo_set_source_rgba (ctx_, color.r, color.g, color.b, color.a);
|
||||
cairo_set_operator(ctx_, CAIRO_OPERATOR_SOURCE);
|
||||
cairo_paint(ctx_);
|
||||
restore();
|
||||
fill(color.r, color.g, color.b, color.a);
|
||||
}
|
||||
void DrawContext::save()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue