.rainbow gtk InvertColor

git-svn-id: svn://ultimatepp.org/upp/trunk@5648 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2012-12-12 20:01:29 +00:00
parent 4012a3faa3
commit 4acd97fe0d
2 changed files with 11 additions and 2 deletions

View file

@ -105,9 +105,17 @@ void SystemDraw::DrawRectOp(int x, int y, int cx, int cy, Color color)
{
if(IsNull(color))
return;
SetColor(color);
cairo_rectangle(cr, x, y, cx, cy);
cairo_fill(cr);
if(color == InvertColor()) {
SetColor(White());
cairo_set_operator(cr, CAIRO_OPERATOR_DIFFERENCE);
cairo_fill(cr);
cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
}
else {
SetColor(color);
cairo_fill(cr);
}
}
void SystemDraw::DrawLineOp(int x1, int y1, int x2, int y2, int width, Color color)

View file

@ -105,6 +105,7 @@ struct MyApp : TopWindow {
w.DrawText(100, y, log[i]);
y += fcy;
}
w.DrawRect(0, 0, 50, fcy * 3, InvertColor());
}
MyApp() {